 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 bool testbit (
unsigned int x,
unsigned int i)
23 return (
x & (1U <<
i)) != 0;
48 std::vector<float> temp_Moments;
52 std::vector<float>::const_iterator i_mom = temp_Moments.begin();
53 std::vector<float>::const_iterator i_mom_e = temp_Moments.end();
56 unsigned int nkeys =
keys.size();
60 std::vector<float> tmp_badChannelEta;
61 std::vector<float> tmp_badChannelPhi;
66 std::vector<float> tmp_rawE;
67 std::vector<float> tmp_rawEtaPhiM;
69 C.expandToFloat(pers->
m_rawE,tmp_rawE);
70 std::vector<float>::const_iterator iraw1 = tmp_rawE.begin();
71 std::vector<float>::const_iterator iraw2 = tmp_rawE.end();
75 std::vector<float>::const_iterator iraw3 = tmp_rawEtaPhiM.begin();
76 std::vector<float>::const_iterator iraw4 = tmp_rawEtaPhiM.end();
82 bool mom_overrun_err =
false;
83 bool store_overrun_err =
false;
84 bool raw_overrun_err =
false;
91 log << MSG::WARNING <<
" problem to decode bad channel information, not filled..." <<
endmsg;
114 for (
int i=0;
i<nVar;++
i) {
118 for (
int j=0;j<nSamplings; ++j){
122 if (
c1 < dataStore_size)
126 if (!store_overrun_err) {
128 "CaloClusterContainerCnv_p5")
129 <<
"Corrupted data: data store array overrun "
130 << pers->
m_vec.size() <<
" clusters "
131 << nkeys <<
" moment keys "
132 << temp_Moments.size() <<
" total moments.";
133 store_overrun_err =
true;
137 static_cast<samptype
>(j),
143 static_cast<samptype
>(j));
160 for (
unsigned short i=0;
i<nkeys;++
i) {
162 if (i_mom == i_mom_e) {
164 if (!mom_overrun_err) {
166 "CaloClusterContainerCnv_p5")
167 <<
"Corrupted data: moment array overrun "
168 << pers->
m_vec.size() <<
" clusters "
169 << nkeys <<
" moment keys "
170 << temp_Moments.size() <<
" total moments.";
171 mom_overrun_err =
true;
178 transStore.insert (transStore.end(), CaloClusterMomentStore::moment_store::value_type(
keys[
i],
val ) );
185 while (ibad1 != ibad2 && (*ibad1) ==
index) {
186 float eta = tmp_badChannelEta[nbad] + transCluster->
eta();
200 if (iraw1 != iraw2) {
201 if (std::fabs(transCluster->
e())>0.1) {
202 transCluster->
m_rawE = (*iraw1) * transCluster->
e();
205 transCluster->
m_rawE = (*iraw1);
208 if (iraw3 != iraw4) {
209 transCluster->
m_rawEta = (*iraw3) + transCluster->
eta();
212 if (iraw3 != iraw4) {
216 if (iraw3 == iraw4 && !raw_overrun_err) {
218 "CaloClusterContainerCnv_p5")
219 <<
"Corrupted data: raw array overrun "
220 << pers->
m_vec.size() <<
" clusters "
221 << tmp_rawE.size() <<
" raw values.";
222 raw_overrun_err =
true;
224 if (iraw3 != iraw4) {
225 transCluster->
m_rawM = (*iraw3);
240 if (i_mom != i_mom_e && !mom_overrun_err) {
242 "CaloClusterContainerCnv_p5")
243 <<
"Corrupted data: not all moments read "
244 << pers->
m_vec.size() <<
" clusters "
245 << nkeys <<
" moment keys "
246 << temp_Moments.size() <<
" total moments "
247 << i_mom-temp_Moments.begin() <<
" read.";
250 if (
c1 != dataStore_size && !store_overrun_err) {
252 "CaloClusterContainerCnv_p5")
253 <<
"Corrupted data: not all data store members read "
254 << dataStore_size <<
" elements "
258 if (iraw1 != iraw2 && !raw_overrun_err) {
260 "CaloClusterContainerCnv_p5")
261 <<
"Corrupted data: not all raw values read "
262 << pers->
m_vec.size() <<
" clusters "
263 << tmp_rawE.size() <<
" raw values "
264 << iraw1-tmp_rawE.begin() <<
" read.";
267 if (iraw3 != iraw4 && !raw_overrun_err) {
269 "CaloClusterContainerCnv_p5")
270 <<
"Corrupted data: not all raw values read "
271 << pers->
m_vec.size() <<
" clusters "
272 << tmp_rawEtaPhiM.size() <<
" raw values "
273 << iraw3-tmp_rawEtaPhiM.begin() <<
" read.";
277 if (ibad1 != ibad2) {
279 "CaloClusterContainerCnv_p5")
280 <<
"Corrupted data: not all bad data read "
294 MsgStream &
log)
const
336 for (
int w=0;
w<nMom;
w++){
344 "CaloClusterContainerCnv_p5")
345 <<
"Inconsistent number of cluster moments: cluster "
346 << it2 - trans->
begin() <<
" of " << trans->
size()
347 <<
" have " <<
ms.size()
353 std::vector<float> temp_Moments;
355 std::vector<float> tmp_badChannelEta;
356 std::vector<float> tmp_badChannelPhi;
358 std::vector<float> tmp_rawE;
359 std::vector<float> tmp_rawEtaPhiM;
360 tmp_rawE.reserve(trans->
size());
361 tmp_rawEtaPhiM.reserve(3*trans->
size());
383 for (
int i=0;
i<nVar;++
i) {
388 for (
int j=0;j<nSamplings; ++j)
389 if ( testbit(
cl.m_samplingPattern, j)) {
391 (
static_cast<vartype
>(
i),
392 static_cast<samptype
>(j)));
397 for (
int j=0;j<nSamplings; ++j)
398 if ( testbit(
cl.m_samplingPattern, j))
404 for (
int j=0;j<nSamplings; ++j)
405 if ( testbit(
cl.m_samplingPattern, j))
407 static_cast<samptype
>(j)))
410 static_cast<samptype
>(j))
412 <<
"\t sampling: "<<j<<
endmsg;
420 std::vector<unsigned short>::const_iterator itk =
422 std::vector<unsigned short>::const_iterator itk_e =
425 cl.m_momentStore.begin();
427 cl.m_momentStore.end();
428 for (; itk != itk_e; ++itk) {
430 if (itm != itm_e && itm.getMomentType() == *itk) {
431 val = (*itm).getValue();
435 itm =
cl.m_momentStore.find
438 val = (*itm).getValue();
442 temp_Moments.push_back(
val);
450 float etac =
bad.getEta()-(
cl.eta());
454 short status = ((sampl & 0xff) | ((
flag.packedData() & 0xff) << 8));
455 tmp_badChannelEta.push_back(etac);
456 tmp_badChannelPhi.push_back(phic);
463 if (std::fabs(
e)>0.1) {
465 tmp_rawE.push_back(
eratio);
468 tmp_rawE.push_back(
cl.m_rawE);
469 tmp_rawEtaPhiM.push_back(
cl.m_rawEta-
cl.eta());
471 tmp_rawEtaPhiM.push_back( dphi);
472 tmp_rawEtaPhiM.push_back(
cl.m_rawM);
488 C.reduce(tmp_rawE,pers->
m_rawE);
505 MsgStream&
log)
const
529 MsgStream&
log)
const
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
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
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.
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.
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
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)
}
ElementLinkCnv_p2< ElementLink< CaloShowerContainer > > m_showerElementLinkCnv
unsigned int m_samplingPattern
unsigned short m_nMoments
unsigned int m_varTypePattern
ElementLinkInt_p2 m_dataLink
std::vector< short > m_badLayerStatusList
ElementLinkInt_p2 m_cellLink
double m_altE
Stores calibrated (cell weight) signal.
CaloTowerSeg_p1 m_towerSeg
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...
virtual double getBasicEnergy() const
Access basic energy scale signal.
bool setDefaultSignalState(signalstate_t s)
Sets default signal state.
P4EEtaPhiMCnv_p2 m_P4EEtaPhiMCnv
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.
unsigned int m_caloRecoStatus
void persToTrans(const CaloTowerSeg_p1 *, CaloTowerSeg *) const
ElementLinkCnv_p2< ElementLink< CaloShowerContainer > >::State ShowerLinkState
ElementLinkContNames_p2 m_linkNames
cell_link_type m_cellLink
Local pointer to cell store.
data_link_type m_dataLink
{
std::vector< unsigned int > m_rawE
ElementLinkCnv_p2< ElementLink< CaloCellLinkContainer > >::State CellLinkState
size_t getNumberOfSamplings() const
Set variable type pattern for this store.
double m_phi0
Cluster seed
unsigned int m_varTypePattern
void expandToFloat(const std::vector< unsigned int > &vc, std::vector< float > &vf)
size_t getNumberOfVariableTypes() const
Return number of variable types.
void reduce(const std::vector< float > &vf, std::vector< unsigned int > &vi)
bool m_endcap
Flag is true if at least one cell in EMB.
CaloSamplingData m_dataStore
{\ brief Cached Stores
ElementLinkCnv_p2< ElementLink< CaloCellLinkContainer > > m_cellElementLinkCnv
double m_altM
Stores calibrated (cell weight) signal.
Principal data class for CaloCell clusters.
CaloPhiRange class declaration.
double m_rawM
Stores raw signal.
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)
virtual void transToPers(const CaloClusterContainer *trans, CaloClusterContainer_p5 *pers, MsgStream &log) const override
virtual void persToTrans(const CaloClusterContainer_p5 *pers, CaloClusterContainer *trans, MsgStream &log) const override
void clear()
Erase all the elements in the collection.
void persToTrans(State &state, const PersLink_t &pers, Link_t &trans, MsgStream &log) const
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
std::vector< float > m_dataStore
double m_rawPhi
Stores raw signal.
std::vector< unsigned int > m_badPhiList
double getTime() const
Access cluster time.
Helpers for checking error return status codes and reporting errors.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
std::vector< unsigned int > m_badEtaList
CaloRecoStatus m_status
Calorimeter reconstruction status.
contType::const_iterator const_iterator
double m_altEta
Stores calibrated (cell weight) signal.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
CaloTowerSegCnv_p1 m_caloTowerSegCnv
unsigned int m_clusterSize
std::vector< unsigned int > m_rawEtaPhiM
contType::iterator iterator
std::vector< short > m_badClusIndexList
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.
CaloClusterMomentContainer_p2 m_momentContainer
std::vector< unsigned short > m_Mkey
P4EEtaPhiMFloat_p2 m_P4EEtaPhiM
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.
Simple data object to store all variables in calorimeter samplings.
setBGCode setTAP setLVL2ErrorBits bool
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.
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...
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.