|
ATLAS Offline Software
|
Go to the documentation of this file.
20 bool testbit (
unsigned int x,
unsigned int i)
22 return (
x & (1U <<
i)) != 0;
47 std::vector<float> temp_Moments;
51 std::vector<float>::const_iterator i_mom = temp_Moments.begin();
52 std::vector<float>::const_iterator i_mom_e = temp_Moments.end();
55 unsigned int nkeys =
keys.size();
59 std::vector<float> tmp_badChannelEta;
60 std::vector<float> tmp_badChannelPhi;
65 std::vector<float> tmp_rawE;
68 std::vector<float>::const_iterator iraw1 = tmp_rawE.begin();
69 std::vector<float>::const_iterator iraw2 = tmp_rawE.end();
75 bool mom_overrun_err =
false;
76 bool store_overrun_err =
false;
77 bool raw_overrun_err =
false;
84 log << MSG::WARNING <<
" problem to decode bad channel information, not filled..." <<
endmsg;
107 for (
int i=0;
i<nVar;++
i) {
111 for (
int j=0;j<nSamplings; ++j){
115 if (
c1 < dataStore_size)
119 if (!store_overrun_err) {
121 "CaloClusterContainerCnv_p4")
122 <<
"Corrupted data: data store array overrun "
123 << pers->
m_vec.size() <<
" clusters "
124 << nkeys <<
" moment keys "
125 << temp_Moments.size() <<
" total moments.";
126 store_overrun_err =
true;
130 static_cast<samptype
>(j),
136 static_cast<samptype
>(j));
153 for (
unsigned short i=0;
i<nkeys;++
i) {
155 if (i_mom == i_mom_e) {
157 if (!mom_overrun_err) {
159 "CaloClusterContainerCnv_p4")
160 <<
"Corrupted data: moment array overrun "
161 << pers->
m_vec.size() <<
" clusters "
162 << nkeys <<
" moment keys "
163 << temp_Moments.size() <<
" total moments.";
164 mom_overrun_err =
true;
171 transStore.insert (transStore.end(), CaloClusterMomentStore::moment_store::value_type(
keys[
i],
val ) );
178 while (ibad1 != ibad2 && (*ibad1) ==
index) {
179 float eta = tmp_badChannelEta[nbad] + transCluster->
eta();
193 if (iraw1 != iraw2) {
194 if (std::fabs(transCluster->
e())>0.1) {
195 transCluster->
m_rawE = (*iraw1) * transCluster->
e();
198 transCluster->
m_rawE = (*iraw1);
201 if (iraw1 != iraw2) {
202 transCluster->
m_rawEta = (*iraw1) + transCluster->
eta();
205 if (iraw1 != iraw2) {
209 if (iraw1 == iraw2 && !raw_overrun_err) {
211 "CaloClusterContainerCnv_p4")
212 <<
"Corrupted data: raw array overrun "
213 << pers->
m_vec.size() <<
" clusters "
214 << tmp_rawE.size() <<
" raw values.";
215 raw_overrun_err =
true;
217 if (iraw1 != iraw2) {
218 transCluster->
m_rawM = (*iraw1);
234 if (i_mom != i_mom_e && !mom_overrun_err) {
236 "CaloClusterContainerCnv_p4")
237 <<
"Corrupted data: not all moments read "
238 << pers->
m_vec.size() <<
" clusters "
239 << nkeys <<
" moment keys "
240 << temp_Moments.size() <<
" total moments "
241 << i_mom-temp_Moments.begin() <<
" read.";
244 if (
c1 != dataStore_size && !store_overrun_err) {
246 "CaloClusterContainerCnv_p4")
247 <<
"Corrupted data: not all data store members read "
248 << dataStore_size <<
" elements "
252 if (iraw1 != iraw2 && !raw_overrun_err) {
254 "CaloClusterContainerCnv_p4")
255 <<
"Corrupted data: not all raw values read "
256 << pers->
m_vec.size() <<
" clusters "
257 << tmp_rawE.size() <<
" raw values "
258 << iraw1-tmp_rawE.begin() <<
" read.";
261 if (ibad1 != ibad2) {
263 "CaloClusterContainerCnv_p4")
264 <<
"Corrupted data: not all bad data read "
279 MsgStream &
log)
const
320 for (
int w=0;
w<nMom;
w++){
328 "CaloClusterContainerCnv_p4")
329 <<
"Inconsistent number of cluster moments: cluster "
330 << it2 - trans->
begin() <<
" of " << trans->
size()
331 <<
" have " <<
ms.size()
337 std::vector<float> temp_Moments;
339 std::vector<float> tmp_badChannelEta;
340 std::vector<float> tmp_badChannelPhi;
342 std::vector<float> tmp_rawE;
343 tmp_rawE.reserve(4*trans->
size());
365 for (
int i=0;
i<nVar;++
i) {
370 for (
int j=0;j<nSamplings; ++j)
371 if ( testbit(
cl.m_samplingPattern, j)) {
373 (
static_cast<vartype
>(
i),
374 static_cast<samptype
>(j)));
379 for (
int j=0;j<nSamplings; ++j)
380 if ( testbit(
cl.m_samplingPattern, j))
386 for (
int j=0;j<nSamplings; ++j)
387 if ( testbit(
cl.m_samplingPattern, j))
389 static_cast<samptype
>(j)))
392 static_cast<samptype
>(j))
394 <<
"\t sampling: "<<j<<
endmsg;
402 std::vector<unsigned short>::const_iterator itk =
404 std::vector<unsigned short>::const_iterator itk_e =
407 cl.m_momentStore.begin();
409 cl.m_momentStore.end();
410 for (; itk != itk_e; ++itk) {
412 if (itm != itm_e && itm.getMomentType() == *itk) {
413 val = (*itm).getValue();
417 itm =
cl.m_momentStore.find
420 val = (*itm).getValue();
424 temp_Moments.push_back(
val);
432 float etac =
bad.getEta()-(
cl.eta());
436 short status = ((sampl & 0xff) | ((
flag.packedData() & 0xff) << 8));
437 tmp_badChannelEta.push_back(etac);
438 tmp_badChannelPhi.push_back(phic);
445 if (std::fabs(
e)>0.1) {
447 tmp_rawE.push_back(
eratio);
450 tmp_rawE.push_back(
cl.m_rawE);
451 tmp_rawE.push_back(
cl.m_rawEta-
cl.eta());
453 tmp_rawE.push_back( dphi);
454 tmp_rawE.push_back(
cl.m_rawM);
480 MsgStream&
log)
const
504 MsgStream&
log)
const
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
ElementLinkInt_p2 m_cellLink
MomentType
enums to identify different moments
char data[hepevt_bytes_allocation_ATLAS]
double phi0() const
Returns raw of cluster seed.
setCharge setNTRTHiThresholdHits eratio
CaloClusterMomentStore m_momentStore
cluster moments
std::vector< short > m_badLayerStatusList
Const iterator class for DataVector/DataList.
void setTime(double theTime)
Set cluster time.
static const AthenaBarCode_t UNDEFINEDBARCODE
double m_altPhi
Stores calibrated (cell weight) signal.
ElementLinkCnv_p2< ElementLink< CaloCellLinkContainer > > m_cellElementLinkCnv
value_type retrieveData(variable_key_type theVariable, sampling_key_type theSampling) const
Retrieve const reference to individual variable.
Scalar phi() const
phi method
virtual const CaloTowerSeg & getTowerSeg() const
Retrieve tower segmentation.
std::vector< short > m_badClusIndexList
void transToPers(State &state, const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Scalar eta() const
pseudorapidity method
double m_eta0
Cluster seed
std::vector< unsigned int > m_badPhiList
virtual void setMomentStore(const moment_store &rMomStore)
Set internal store.
Storable container for CaloCluster.
bool storeData(variable_key_type theVariable, sampling_key_type theSampling, value_type theData)
}
unsigned short m_nMoments
unsigned int m_varTypePattern
double m_altE
Stores calibrated (cell weight) signal.
Internally used iterator.
virtual void transToPers(const P4EEtaPhiM *transObj, P4EEtaPhiMFloat_p2 *persObj, MsgStream &log) const override
Method creating the persistent representation P4EEtaPhiMFloat_p2 from its transient representation P4...
std::vector< unsigned int > m_badEtaList
virtual double getBasicEnergy() const
Access basic energy scale signal.
bool setDefaultSignalState(signalstate_t s)
Sets default signal state.
bool removeVariable(variable_key_type theVariable, sampling_key_type theSampling)
Remove a certain variable.
std::vector< unsigned int > m_Mvalue
Stores CaloClusterMoment in a keyed map.
void persToTrans(const CaloTowerSeg_p1 *, CaloTowerSeg *) const
contType::iterator iterator
cell_link_type m_cellLink
Local pointer to cell store.
data_link_type m_dataLink
{
size_t getNumberOfSamplings() const
Set variable type pattern for this store.
unsigned int m_samplingPattern
double m_phi0
Cluster seed
size_t getNumberOfVariableTypes() const
Return number of variable types.
bool m_endcap
Flag is true if at least one cell in EMB.
CaloSamplingData m_dataStore
{\ brief Cached Stores
double m_altM
Stores calibrated (cell weight) signal.
ElementLinkCnv_p2< ElementLink< CaloShowerContainer > > m_showerElementLinkCnv
Principal data class for CaloCell clusters.
CaloPhiRange class declaration.
double m_rawM
Stores raw signal.
CaloTowerSeg_p1 m_towerSeg
void transToPers(const CaloTowerSeg *, CaloTowerSeg_p1 *) const
unsigned int m_samplingPattern
Sampling pattern.
std::vector< CaloClusterBadChannelData > badChannelList
Get Bad Channel information.
static double fix(double phi)
void clear()
Erase all the elements in the collection.
void persToTrans(State &state, const PersLink_t &pers, Link_t &trans, MsgStream &log) const
unsigned int m_clusterSize
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
std::vector< unsigned int > m_rawEEtaPhiM
double m_rawPhi
Stores raw signal.
double getTime() const
Access cluster time.
ElementLinkInt_p2 m_dataLink
Helpers for checking error return status codes and reporting errors.
std::vector< float > m_dataStore
value_type push_back(value_type pElem)
Add an element to the end of the collection.
contType::const_iterator const_iterator
CaloClusterMomentContainer_p2 m_momentContainer
CaloRecoStatus m_status
Calorimeter reconstruction status.
double m_altEta
Stores calibrated (cell weight) signal.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
unsigned int getClusterSize() const
Get cluster size.
std::map< moment_key, moment_value > moment_store
Internal moment store type.
virtual double eta() const
Retrieve eta independent of signal state.
ElementLinkContNames_p2 m_linkNames
unsigned int m_varTypePattern
ElementLinkCnv_p2< ElementLink< CaloCellLinkContainer > >::State CellLinkState
std::vector< unsigned short > m_Mkey
P4EEtaPhiMCnv_p2 m_P4EEtaPhiMCnv
virtual void persToTrans(const CaloClusterContainer_p4 *pers, CaloClusterContainer *trans, MsgStream &log) const override
virtual double e() const
Retrieve energy independent of signal state.
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
virtual const store_type & getStatusWord() const
retrieve the entire status word
double m_rawE
Stores raw signal.
double eta0() const
Returns raw of cluster seed.
Data object stores CaloTower segmentation.
virtual void setTowerSeg(const CaloTowerSeg &towerSeg)
Set tower segmentation into CaloClusterContainer.
virtual void setBasicEnergy(double theEnergy)
Set basic energy scale signal.
virtual void transToPers(const CaloClusterContainer *trans, CaloClusterContainer_p4 *pers, MsgStream &log) const override
Simple data object to store all variables in calorimeter samplings.
CaloTowerSegCnv_p1 m_caloTowerSegCnv
setBGCode setTAP setLVL2ErrorBits bool
ElementLinkCnv_p2< ElementLink< CaloShowerContainer > >::State ShowerLinkState
void addBadChannel(const CaloClusterBadChannelData &badChannel)
Add Bad channel information.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
size_type size() const noexcept
Returns the number of elements in the collection.
bool m_barrel
Flag is true if at least one cell in EMB.
unsigned int m_caloRecoStatus
reconstruction status indicator
void resetBadChannel()
Reset Bad channel list.
double m_rawEta
Stores raw signal.
virtual void persToTrans(const P4EEtaPhiMFloat_p2 *persObj, P4EEtaPhiM *transObj, MsgStream &log) const override
Method creating the transient representation of P4EEtaPhiM from its persistent representation P4EEtaP...
P4EEtaPhiMFloat_p2 m_P4EEtaPhiM
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
virtual double phi() const
Retrieve phi independent of signal state.