ATLAS Offline Software
Loading...
Searching...
No Matches
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5//Dear emacs, this is -*-c++-*-
6
7#ifndef CALOEVENT_CALOCLUSTER_H
8#define CALOEVENT_CALOCLUSTER_H
9/***************************************************************************
10 CaloCluster class
11 base class for calorimeter classes
12
13Update: Jan 10 2001 HMA
14 order of static/virtual/const
15
16Update: Redesign. May 21, 2001
17 Concrete base class for Calorimeter cluster
18 Using CaloSampling for sampling information.
19
20Update: Redesign. Nov 12, 2001 efrank
21 Inherit from Navigable to plug into navigation code.
22 Modify addcell() to update token. I realize now that CaloCluster
23 and NavClusterToken may need to be extend so that a weight can
24 be stored with added cells.
25
26Update: Redesign. Mar 06, 2003 P Loch
27 New navigation system.
28
29Update: Redesign. Feb 17, 2004 P Loch
30 Complete overhaul. Now inherits from CaloEnergyCluster (navigable
31 4-vector object with constituents). Non-backward compatible change
32 of interfaces.
33
34Update: Jul 18, 2005 P Loch
35 Add basic signal data word and access methods
36
37Update: Sep 18, 2005 P Loch
38 Completely new EDM with external data objects storing the cell links
39 and cluster data.
40***************************************************************************/
44
47
50
54
58
59#include "CaloEvent/CaloClusterBadChannelData.h"
60
61#include <vector>
62
65
66
67class CaloCell ;
68
69class CaloCluster;
70
71struct CaloClusterSignalState;
72
73
75 public CaloCompositeCellBase<CaloClusterNavigable>,
76 virtual public INavigable4Momentum,
77 public ISignalState,
79{
80
81 public:
82
86 // electrons
90 // photons
94 // early converted photons
98 // soft electrons
100 // topological clusters
103 // transient cluster for AODCellContainer
106 };
107
108
110 // Public Types //
112
116
119
122
124 typedef double value_type;
125
126
139
140 // xAOD compatibility.
142
143 typedef double (CaloCluster::*GET_VALUE)() const;
144 typedef void (CaloCluster::*SET_VALUE)(double v);
145
148
150 // MomentStore Iterator //
152
155 {
156 public:
157
162 const moment_store* firstStore,
163 const moment_store* secndStore=0) ;
166
169
172
181
183 bool operator==(const MomentStoreIter& anOther) const;
185 bool operator!=(const MomentStoreIter& anOther) const;
186
188 const CaloClusterMoment& operator*() const;
190 const CaloClusterMoment& getMoment() const;
193
194 private:
195
202 };
203
206
208 // Constructors & Destructors //
210
212 CaloCluster(double eta0 = 0, double phi0 = 0,
213 unsigned int varTypePattern = 0x00000000,
214 unsigned int clusterSize=CaloCluster::SW_55ele);
216 virtual ~CaloCluster();
218 CaloCluster(const CaloCluster* pCluster);
219 CaloCluster(const CaloCluster& rCluster);
220
222 // General Set and Get for all Variables //
224
226 double
227 getVariable(const variable_type& varType,
228 const sampling_type& samType,
229 bool useLink = true) const;
230
232 bool
233 getVariable(const variable_type& varType,
234 std::vector<double>& varList,
235 bool useLink = true) const;
236
238 bool
239 setVariable(const variable_type& varType,
240 const sampling_type& samType,
241 const double& varData,
242 bool useLink = false);
244 bool
245 setVariable(const variable_type& varType,
246 const std::vector<double>& varList,
247 bool useLink = false);
248
249
251 bool
252 lockVariable(const variable_type& varType);
253
255 bool
256 unlockVariable(const variable_type& varType);
257
259 bool isLocked(const variable_type& varType) const;
260 bool isLocked(const unsigned int& bitPattern) const;
261
263 bool allLocked() const;
264
266 // Kinematics //
268
270 virtual CLHEP::HepLorentzVector hlv() const {return CaloCompositeKineBase::hlv();}
271
273 virtual CLHEP::HepLorentzVector hlv(signalstate_t s) const;
274
276 virtual double e() const;
278 virtual double eta() const;
280 virtual double phi() const;
282 virtual double m() const;
283
285 double e(signalstate_t s) const;
287 double eta(signalstate_t s) const;
289 double phi(signalstate_t s) const;
291 double m(signalstate_t s) const;
292
294 virtual void setE(double e);
296 virtual void setEta(double eta);
298 virtual void setPhi(double phi);
300 virtual void setM(double m);
301
303 virtual void set4Mom(const I4Momentum* const pMom);
305 virtual void set4Mom(const I4Momentum& rMom);
307 virtual void set4Mom(const CLHEP::HepLorentzVector& rVec);
308
310 unsigned int nSamples() const;
312 double eSample(sampling_type sampling) const;
314 double etaSample(sampling_type sampling) const;
316 double phiSample(sampling_type sampling) const;
317
319 void getEInSamples(std::vector<double>& theEnergies) const;
321 void getEtaInSamples( std::vector<double>& theEtas) const;
323 void getPhiInSamples( std::vector<double>& thePhis) const;
324
326 void setEInSamples(const std::vector<double>& theEnergies);
328 void setEtaInSamples(const std::vector<double>& theEtas);
330 void setPhiInSamples(const std::vector<double>& thePhis);
332 virtual double getBasicEnergy() const;
334 virtual void setBasicEnergy(double theEnergy);
336 double getTime() const;
338 void setTime(double theTime);
339
341 void setClusterSize(unsigned int theClusterSize);
342
344 unsigned int getClusterSize() const;
345
346 /* \brief Get eta/phi size from cluster size */
347 unsigned int getClusterEtaSize() const;
348 unsigned int getClusterPhiSize() const;
349
351 void setenergy(sampling_type sampling, double e);
353 void seteta (sampling_type sampling, double eta);
355 void setphi (sampling_type sampling, double phi);
356
358 // Cluster Moments //
360
362 void insertMoment(const moment_type& momType,
363 const moment_value& momValue,
364 bool useLink=true);
366 moment_iterator beginMoment(bool useLink=true) const;
368 moment_iterator endMoment(bool useLink=true) const;
370 bool retrieveMoment(const moment_type& momType,
371 moment_value& momValue,
372 bool useLink=true) const;
373 bool retrieveMoment(const moment_type& momType,
374 double& momData,
375 bool useLink=true) const;
377 moment_value getMoment(const moment_type& momType,
378 bool useLink=true) const;
380 moment_value getMoment(const moment_iterator& momIter) const;
381
383 double getMomentValue(const moment_type& momType,
384 bool useLink=true) const;
385 double getMomentValue(const moment_iterator& momIter) const;
386
388 moment_type getMomentType(const moment_iterator& momIter) const;
389
391 // Special Variables //
393
396 bool is_valid_sampling(const sampling_type& sampling) const;
399 bool isEMSampling(const sampling_type& theSampling) const;
401 bool hasSampling(const sampling_type& theSampling) const;
403 unsigned int samplingPattern() const;
404
406 double eta0() const;
408 double phi0() const;
409
411 double etasize(sampling_type sampling) const;
413 double phisize(sampling_type sampling) const;
415 void setetasize(sampling_type sampling, double size);
417 void setphisize(sampling_type sampling, double size) ;
418
420 double energy_max(sampling_type sampling) const;
423 double etamax(sampling_type sampling) const;
426 double phimax(sampling_type sampling) const;
428 void setenergymax(sampling_type sampling, double m) ;
431 void setetamax(sampling_type sampling, double m);
434 void setphimax(sampling_type sampling, double m) ;
435
437 double etaBE(int sampling) const;
439 double phiBE(int sampling) const;
441 double energyBE(int sampling) const;
442
444 bool inBarrel() const;
446 bool inEndcap() const;
448 void setBarrel(bool barrel);
450 void setEndcap(bool endcap);
451
453 void addBadChannel(const CaloClusterBadChannelData& badChannel);
455 void resetBadChannel();
456
458 typedef std::vector<CaloClusterBadChannelData> badChannelList;
459 const badChannelList* getBadChannel() const;
460
462 bool containsBadCells() const;
463
465 void calculateKine(const bool useweight=true, const bool updateLayers=true );
466
467 protected:
468
471
472 typedef
474
476 static const double m_errorValue;
477
482
484 // CaloShower* m_dataStorePointer;
486
490
493
496
498 double m_time;
499
501 unsigned int m_samplingPattern;
502
504 virtual void updateKine(const CaloCell* theCell, double weight);
505
506 double variableBE(const variable_type& theVariable,
507 const int& samplingIndex) const;
508
509 CaloSamplingData* getDataStore(const variable_type& theVariable,
510 bool useLink=true);
512 theVariable,
513 bool useLink=false) const;
514
516 getMomentStore(bool useLink=true);
518 getMomentStore(bool useLink=false) const;
520 getMomentStore(const moment_type& theMoment, bool useLink=false) const;
522 getMomentStore(const moment_type& theMoment, bool useLink=true);
523 bool
524 getMomentStorePtrs(const CaloClusterMomentStore*& pFirstStore,
525 const CaloClusterMomentStore*& pSecndStore,
526 bool useLink) const;
527 //DEBUG const std::string& mode) const;
528
530 bool setDataLink(CaloShowerContainer* pDataLink);
531
533 bool setStores(CaloShower* pData,CaloCellLink* pLink,bool ownStores=true);
534
536 bool setDataStore(CaloShower* pData,bool ownStores=true);
537
538 private:
539
542 template <class InputIterator>
543 void
545 InputIterator beg,
546 InputIterator end);
547
549 bool m_barrel;
552
554 unsigned int m_clusterSize;
555
556 // ... RAW eta,phi of cluster seed
558 double m_eta0;
560 double m_phi0;
561
565
568 double m_posNorm;
569
572 std::vector<double> m_posSamNorm;
573
581 unsigned int m_lockPattern;
582
584
586 // Signal States //
588
589 public:
590
595
597 virtual bool hasSignalState(signalstate_t s) const;
599 virtual bool isAtSignalState(signalstate_t s) const;
600
601 protected:
602
604 virtual bool setSignalState(signalstate_t s);
605
607 virtual void resetSignalState();
608
611
612 private:
613
615 double getRawE() const;
617 double getRawEta() const;
619 double getRawPhi() const;
621 double getRawM() const;
622
624 double getCalE() const;
626 double getCalEta() const;
628 double getCalPhi() const;
630 double getCalM() const;
631
633 double getAltE() const;
635 double getAltEta() const;
637 double getAltPhi() const;
639 double getAltM() const;
640
642 void setRawE(double e);
644 void setRawEta(double eta);
646 void setRawPhi(double phi);
648 void setRawM(double m);
649
651 void setCalE(double e);
653 void setCalEta(double eta);
655 void setCalPhi(double phi);
657 void setCalM(double m);
658
660 void setAltE(double e);
662 void setAltEta(double eta);
664 void setAltPhi(double phi);
666 void setAltM(double m);
667
668 // Cint has trouble with the types of these members.
669 // Just hide them from reflex for now.
670#ifndef __REFLEX__
679
688#endif
689
694
696 double m_rawE;
698 double m_rawEta;
700 double m_rawPhi;
702 double m_rawM;
703
705 double m_altE;
707 double m_altEta;
709 double m_altPhi;
711 double m_altM;
712
714 bool setStateRaw();
715
717 bool setStateCal();
718
720 bool setStateAlt();
721
722public:
723 // For interactive debugging from python ---
724 // should not be used from client code.
727
728private:
731
741
742};
743
745// Inline Funtions //
747
749// Kinematics //
751
752#ifndef __REFLEX__
753inline double CaloCluster::e() const
754{ return (this->*m_getE)(); }
755inline double CaloCluster::eta() const
756{
757 return (this->*m_getEta)();
758}
759inline double CaloCluster::phi() const
760{
761 return (this->*m_getPhi)();
762}
763
764inline double CaloCluster::m() const
765{ return (this->*m_getM)(); }
766
767inline void CaloCluster::setE(double e)
768{ (this->*m_setE)(e); }
769inline void CaloCluster::setEta(double eta)
770{ (this->*m_setEta)(eta); }
771inline void CaloCluster::setPhi(double phi)
772{ (this->*m_setPhi)(phi); }
773inline void CaloCluster::setM(double m)
774{ (this->*m_setM)(m); }
775#endif
776
777inline double CaloCluster::e(signalstate_t s) const
778{
779 if (!hasSignalState(s)) return m_errorValue;
780 switch (s) {
782 return P4EEtaPhiM::e();
784 return m_rawE;
786 return m_altE;
787 default:
788 return m_errorValue;
789 }
790}
791
792
793inline double CaloCluster::eta(signalstate_t s) const
794{
795 if (!hasSignalState(s)) return m_errorValue;
796 switch (s) {
798 return P4EEtaPhiM::eta();
800 return m_rawEta;
802 return m_altEta;
803 default:
804 return m_errorValue;
805 }
806}
807
808
809inline double CaloCluster::phi(signalstate_t s) const
810{
811 if (!hasSignalState(s)) return m_errorValue;
812 switch (s) {
814 return P4EEtaPhiM::phi();
816 return m_rawPhi;
818 return m_altPhi;
819 default:
820 return m_errorValue;
821 }
822}
823
824
825inline double CaloCluster::m(signalstate_t s) const
826{
827 if (!hasSignalState(s)) return m_errorValue;
828 switch (s) {
830 return P4EEtaPhiM::m();
832 return m_rawM;
834 return m_altM;
835 default:
836 return m_errorValue;
837 }
838}
839
840
841inline void CaloCluster::set4Mom(const I4Momentum* const pMom)
842{
843 this->setE(pMom->e());
844 this->setEta(pMom->eta());
845 this->setPhi(pMom->phi());
846 this->setM(pMom->m());
847}
848
849inline void CaloCluster::set4Mom(const I4Momentum& rMom)
850{ this->set4Mom(&rMom); }
851
852inline void CaloCluster::set4Mom(const CLHEP::HepLorentzVector& rVec)
853{
854 this->setE(rVec.e());
855 this->setEta(rVec.eta());
856 this->setPhi(rVec.phi());
857 this->setM(rVec.m());
858}
859
864
866{
867 m_defSigState = s;
868 return this->setSignalState(s);
869}
870
872// Basic Signal and Time //
874
875inline double
882inline void
883CaloCluster::setBasicEnergy(double theEnergy) { m_basicSignal = theEnergy; }
884
885inline double
886CaloCluster::getTime() const { return m_time; }
887
888inline void
889CaloCluster::setTime(double theTime) { m_time = theTime; }
890
891inline void
892CaloCluster::setClusterSize(unsigned int theClusterSize) { m_clusterSize = theClusterSize; }
893
894inline unsigned int
896
898// Configuration //
900
901inline bool
902CaloCluster::setStores(CaloShower* pData, CaloCellLink* pLink, bool ownStores)
903{
904 return ( this->setDataStore(pData,ownStores) &&
905 this->setLinkStore(pLink,ownStores) );
906}
907
908inline bool
910{
911 // m_dataStorePointer = pData;
912 m_ownDataStore = ownStores;
913 m_dataLink.setElement(pData);
914 m_shower = pData;
915 return m_dataLink.isValid();
916}
917
919// Tags //
921
926inline bool CaloCluster::inBarrel() const { return m_barrel; }
931inline bool CaloCluster::inEndcap() const { return m_endcap; }
939inline void CaloCluster::setEndcap(bool endcap) { m_endcap = endcap; }
947inline bool
949{ return this->isEMSampling(sampling); }
950
951inline bool CaloCluster::isEMSampling(const sampling_type& theSampling) const
952{ return CaloSamplingHelper::isEMSampling(theSampling); }
953
954inline bool CaloCluster::hasSampling(const sampling_type& theSampling) const
955{
956 unsigned int bitPattern = CaloSamplingHelper::getSamplingBit(theSampling);
957 return (m_samplingPattern & bitPattern) == bitPattern;
958}
959
961// Get Energy/Eta/Phi in Samplings //
963
968inline unsigned int CaloCluster::nSamples() const
970
975inline double CaloCluster::eSample(sampling_type theSampling) const
976{ return this->getVariable(CaloVariableType::ENERGY,theSampling,true); }
977
983inline void CaloCluster::getEInSamples(std::vector<double>& theEnergies) const
984{ this->getVariable(CaloVariableType::ENERGY,theEnergies,true); }
985
991inline double CaloCluster::etaSample(sampling_type theSampling) const
992{ return this->getVariable(CaloVariableType::ETA,theSampling,true); }
993
999inline void CaloCluster::getEtaInSamples(std::vector<double>& theEtas) const
1000{ this->getVariable(CaloVariableType::ETA,theEtas,true); }
1001
1006inline double CaloCluster::phiSample(sampling_type theSampling) const
1007{ return this->getVariable(CaloVariableType::PHI,theSampling,true); }
1008
1015inline void CaloCluster::getPhiInSamples(std::vector<double>& thePhis) const
1016{ this->getVariable(CaloVariableType::PHI,thePhis,true); }
1017
1019// Set Methods for Sampling Kinematic //
1021
1029inline void CaloCluster::setenergy(sampling_type theSampling, double theEnergy)
1030{ this->setVariable(CaloVariableType::ENERGY,theSampling,theEnergy,true); }
1031
1041inline void CaloCluster::setEInSamples(const std::vector<double>& theEnergies)
1042{ this->setVariable(CaloVariableType::ENERGY,theEnergies,true); }
1043
1048inline void CaloCluster::seteta(sampling_type sampling, double eta)
1049{ this->setVariable(CaloVariableType::ETA,sampling,eta,true); }
1050
1061inline void CaloCluster::setEtaInSamples(const std::vector<double>& theEtas)
1062{ this->setVariable(CaloVariableType::ETA,theEtas,true); }
1063
1068inline void CaloCluster::setphi(sampling_type sampling, double phi)
1069{ this->setVariable(CaloVariableType::PHI,sampling,phi,true); }
1070
1081inline void CaloCluster::setPhiInSamples(const std::vector<double>& thePhis)
1082{ this->setVariable(CaloVariableType::PHI,thePhis,true); }
1083
1085// Energy/eta/phi of Maximum Signal Cell //
1087
1096inline double CaloCluster::energy_max(sampling_type sampling) const
1097{
1098 return this->isEMSampling(sampling)
1099 ? this->getVariable(CaloVariableType::MAX_ENERGY,sampling,true)
1100 : double(0);
1101}
1102
1112inline double CaloCluster::etamax(sampling_type sampling) const
1113{
1114 return this->isEMSampling(sampling)
1115 ? this->getVariable(CaloVariableType::MAX_ETA,sampling,true)
1116 : double(0);
1117}
1118
1128inline double CaloCluster::phimax(sampling_type sampling) const
1129{
1130 return this->isEMSampling(sampling)
1131 ? this->getVariable(CaloVariableType::MAX_PHI,sampling,true)
1132 : double(0);
1133}
1134
1136// Cluster Sizes in Samplings //
1138
1148inline double CaloCluster::etasize(sampling_type sampling) const
1149{
1150 return this->isEMSampling(sampling)
1151 ? this->getVariable(CaloVariableType::DELTA_ETA,sampling,true)
1152 : double(0);
1153}
1154
1165inline double CaloCluster::phisize(sampling_type sampling) const
1166{
1167 return this->isEMSampling(sampling)
1168 ? this->getVariable(CaloVariableType::DELTA_PHI,sampling,true)
1169 : double(0);
1170}
1171
1173// Seeds //
1175
1180inline double CaloCluster::eta0() const { return m_eta0; }
1181
1186inline double CaloCluster::phi0() const { return m_phi0; }
1187
1189// Kinematics in Barrel/EndCap EM //
1191
1199inline double CaloCluster::etaBE(int sam) const
1200{ return this->variableBE(CaloVariableType::ETA,sam); }
1201
1209inline double CaloCluster::phiBE(int sam) const
1210{ return this->variableBE(CaloVariableType::PHI,sam); }
1211
1219inline double CaloCluster::energyBE(int sam) const
1220{ return this->variableBE(CaloVariableType::ENERGY,sam); }
1221
1223// Moments //
1225
1226inline CaloClusterMoment
1227CaloCluster::getMoment(const moment_type& momType,bool useLink) const {
1228 CaloClusterMoment value(0.0);
1229 if (!this->retrieveMoment(momType,value,useLink))
1230 value = 0; // Make coverity happy.
1231 return value;
1232}
1233
1234
1235inline CaloClusterMoment
1237{ return rMomIter.getMoment(); }
1238
1239inline double
1240CaloCluster::getMomentValue(const moment_type& momType,bool useLink) const {
1241 double value(0.0);
1242 if (!this->retrieveMoment(momType,value,useLink))
1243 value = 0; // Make coverity happy.
1244 return value;
1245}
1246
1247
1248
1249inline double
1251{ return (momIter.getMoment()).getValue(); }
1252
1255{ return rMomIter.getMomentType(); }
1256
1258// Internal Stores //
1260
1261// set data link store
1263{
1264 if (!pDataLink)
1265 return false;
1266 CaloShower* pData = m_shower;
1267 m_ownDataStore = !pDataLink->ownElements();
1269 pData,
1270 m_dataLink);
1271}
1272
1274// Variable Locking //
1276
1277// check if variable is locked
1278inline bool CaloCluster::isLocked(const variable_type& varType) const
1279{
1280 unsigned int bitPattern(CaloVariableType::getVariableBit(varType));
1281 return this->isLocked(bitPattern);
1282}
1283inline bool CaloCluster::isLocked(const unsigned int& bitPattern) const
1284{
1285 return ( m_lockPattern & bitPattern ) == bitPattern;
1286}
1287
1288// check if all variables are locked
1295
1297// containsBadCell
1299
1301 return !(this->getBadChannel()->empty());
1302}
1303
1304// internal functions
1305
1306
1307// Override the default hash function for NavigationToken so that
1308// we'll get reproducible ordering.
1309inline
1310std::size_t navigationHash (const CaloCluster* p)
1311{
1312 return static_cast<std::size_t> (static_cast<long long>(p->energy_nonvirt()));
1313}
1314
1315
1316template <class InputIterator>
1318 InputIterator beg,
1319 InputIterator end)
1320{
1321 if (this->isLocked (varType)) return;
1322 CaloSamplingData* p = this->getDataStore (varType, true);
1323 if (p)
1324 p->storeData (varType, beg, end);
1325}
1326
1327
1328
1329// check if variable is locked
1367
1380#endif // CALOCLUSTER_H
1381
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
A mixin base class implementing IAthenaBarCode. IAthenaBarCode should be a virtual base of the class ...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
std::size_t navigationHash(const CaloCluster *p)
Define macros for attributes used to control the static checker.
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
Stores CaloClusterMoment in a keyed map.
CaloClusterMomentIterator moment_iterator
External moment iterator type.
CaloClusterMoment::MomentType moment_type
Moment type.
CaloClusterMoment moment_value
Moment data.
defines enums and data types for different moments of CaloCluster
MomentType
enums to identify different moments
virtual object_iter end() const
end iterator for public object access
bool setLinkStore(CaloCellLink *pLink, bool ownStores=true)
const CaloClusterMoment & operator*() const
Operator access to CaloClusterMoment.
const moment_store * m_secndStore
Pointer to second CaloClusterMomentStore.
MomentStoreIter prev()
Step back iterator.
bool operator==(const MomentStoreIter &anOther) const
Equality comparator.
const moment_store * m_firstStore
Pointer to first CaloClusterMomentStore.
MomentStoreIter operator--()
Post-step back operator.
MomentStoreIter next()
Advance iterator.
MomentStoreIter()
Default constructor builds unusable iterator.
moment_iterator_i m_iter
Actual iterator on CaloClusterMomentStore.
bool operator!=(const MomentStoreIter &anOther) const
Inequality comparator.
moment_type getMomentType() const
Function access to moment type.
MomentStoreIter operator++()
Post-advance operator.
const CaloClusterMoment & getMoment() const
Function access to CaloClusterMoment.
Principal data class for CaloCell clusters.
void setphimax(sampling_type sampling, double m)
Set the of cell with maximum energy in a given sampling.
double etamax(sampling_type sampling) const
Retrieve of cell with maximum energy in given sampling.
bool getMomentStorePtrs(const CaloClusterMomentStore *&pFirstStore, const CaloClusterMomentStore *&pSecndStore, bool useLink) const
double eta0() const
Returns raw of cluster seed.
void setRawEta(double eta)
Set raw eta.
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
bool retrieveMoment(const moment_type &momType, moment_value &momValue, bool useLink=true) const
Retrieve individual moment.
virtual CLHEP::HepLorentzVector hlv() const
redefine hlv() here to avoid ambiguities
SET_VALUE m_setM
Pointer to setter functions.
double getAltM() const
Access to calibrated (cell weight) m.
MomentStoreIter moment_iterator
Moment iterator type for CaloCluster clients.
CaloClusterMomentStore m_momentStore
cluster moments
void getEInSamples(std::vector< double > &theEnergies) const
Retrieve energy for all samplings into a vector.
void calculateKine(const bool useweight=true, const bool updateLayers=true)
Calculate cluster kinematics from contained cells.
void setRawM(double m)
Set raw m.
virtual double getBasicEnergy() const
Access basic energy scale signal.
moment_value getMoment(const moment_type &momType, bool useLink=true) const
Get individual moment.
void resetBadChannel()
Reset Bad channel list.
unsigned int getClusterEtaSize() const
bool setStateRaw()
Helper to switch to raw state.
unsigned int m_samplingPattern
Sampling pattern.
double m_altE
Stores calibrated (cell weight) signal.
double phiSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
virtual ~CaloCluster()
Destructor.
virtual double m() const
Retrieve mass independent of signal state.
void maybeSetVariable(variable_type varType, InputIterator beg, InputIterator end)
Set variables of a given type in all samplings at once, taking locking into account.
double getRawPhi() const
Access to raw phi.
void addBadChannel(const CaloClusterBadChannelData &badChannel)
Add Bad channel information.
double energyBE(int sampling) const
EMB/EMEC combined signal.
double energy_max(sampling_type sampling) const
Retrieve maximum cell energy in given sampling.
virtual double e() const
Retrieve energy independent of signal state.
bool containsBadCells() const
Check if cluster has any bad channel in it.
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
moment_type getMomentType(const moment_iterator &momIter) const
Get moment type.
virtual bool hasSignalState(signalstate_t s) const
check if signal state exists for current implementation
double m_altPhi
Stores calibrated (cell weight) signal.
void setCalPhi(double phi)
Set calibrated (LC) phi.
double variableBE(const variable_type &theVariable, const int &samplingIndex) const
Rewrite as for calculation.
virtual bool setSignalState(signalstate_t s)
Sets signal state.
double phimax(sampling_type sampling) const
Retrieve of cell with maximum energy in given sampling.
int m_nEndcap
Counter for number of endcap cells with non-zero weight and energy.
SET_VALUE m_setE
Pointer to setter functions.
double getCalEta() const
Access to calibrated (LC) eta.
double getAltE() const
Access to calibrated (cell weight) energy.
std::vector< CaloClusterBadChannelData > badChannelList
Get Bad Channel information.
bool is_valid_sampling(const sampling_type &sampling) const
Checks if cells from a given sampling in EMB or EMEC (!) are in cluster.
double getRawM() const
Access to raw mass.
void setetamax(sampling_type sampling, double m)
Set the of cell with maximum energy in a given sampling.
double etasize(sampling_type sampling) const
Returns cluster size in for a given sampling.
void insertMoment(const moment_type &momType, const moment_value &momValue, bool useLink=true)
Set individual moment.
void setAltE(double e)
Set calibrated (cell weight) energy.
signalstate_t m_signalState
Stores actual signal state.
double getRawEta() const
Access to raw eta.
void setCalE(double e)
Set calibrated (LC) energy.
double etaBE(int sampling) const
EMB/EMEC combined barycenter .
bool setVariable(const variable_type &varType, const sampling_type &samType, const double &varData, bool useLink=false)
General sampling variable setter.
bool lockVariable(const variable_type &varType)
Lock variable (protect against future updates)
void setEInSamples(const std::vector< double > &theEnergies)
Set energy in all samplings from a vector.
void setRawPhi(double phi)
Set raw phi.
double phiBE(int sampling) const
EMB/EMEC combined barycenter .
void setenergy(sampling_type sampling, double e)
Set energy for a given sampling.
virtual double eta() const
Retrieve eta independent of signal state.
CaloVariableType::VariableType variable_type
Data type indicator.
bool setStateCal()
Helper to switch to calibrated (LC) state.
void seteta(sampling_type sampling, double eta)
Set in a given sampling.
double getTime() const
Access cluster time.
virtual void setEta(double eta)
Set eta.
signalstate_t m_defSigState
Stores default signal state.
virtual bool isAtSignalState(signalstate_t s) const
check if we are at the passed state
moment_iterator beginMoment(bool useLink=true) const
First iterator on moment store.
void setRawE(double e)
Set raw energy.
signalstate_t defaultSignalState() const
Retrieve default signal state.
void setCalM(double m)
Set calibrated (LC) m.
void getEtaInSamples(std::vector< double > &theEtas) const
Retrieve for all samplings into a vector.
double phisize(sampling_type sampling) const
Returns cluster size in for a given sampling.
CaloSamplingData * getDataStore(const variable_type &theVariable, bool useLink=true)
virtual void resetSignalState()
reset the signal state
bool m_endcap
Flag is true if at least one cell in EMB.
double getAltPhi() const
Access to calibrated (cell weight) phi.
std::vector< double > m_posSamNorm
Stores the normalization e.g.
CaloCluster(double eta0=0, double phi0=0, unsigned int varTypePattern=0x00000000, unsigned int clusterSize=CaloCluster::SW_55ele)
Constructor.
moment_store::moment_iterator moment_iterator_i
Cluster moment store iterator type.
double getCalPhi() const
Access to calibrated (LC) phi.
double getCalM() const
Access to calibrated (LC) m.
bool isLocked(const variable_type &varType) const
Check lock status of variable.
CaloClusterLinkTemplate< CaloShowerContainer >::link_type data_link_type
bool unlockVariable(const variable_type &varType)
Unlock variable (remove lock)
double m_altM
Stores calibrated (cell weight) signal.
double etaSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
double getCalE() const
Access to calibrated (LC) energy.
moment_iterator endMoment(bool useLink=true) const
Last iterator on moment store.
double getMomentValue(const moment_type &momType, bool useLink=true) const
Get moment value.
double getVariable(const variable_type &varType, const sampling_type &samType, bool useLink=true) const
General sampling variable access.
void setEtaInSamples(const std::vector< double > &theEtas)
Set in all samplings from a vector.
bool setStateAlt()
Helper to switch to calibrated (cell weight) state.
void setBarrel(bool barrel)
Sets EMB indicator.
virtual void set4Mom(const I4Momentum *const pMom)
Set kinematics from four-vector.
unsigned int samplingPattern() const
Get sampling bitmask.
bool setDefaultSignalState(signalstate_t s)
Sets default signal state.
const badChannelList * getBadChannel() const
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
bool setDataStore(CaloShower *pData, bool ownStores=true)
Setup data store.
double getAltEta() const
Access to calibrated (cell weight) eta.
ClusterSize
enums to identify different cluster size
double m_timeNorm
Stores the normalization for time calculation e.g.
SET_VALUE m_setPhi
Pointer to setter functions.
void setTime(double theTime)
Set cluster time.
void setEndcap(bool endcap)
Sets EMEC indicator.
bool inEndcap() const
Returns true if at least one clustered cell in EMEC.
CaloCluster & operator=(const CaloCluster &)
Disallow (avoid coverity warning).
unsigned int getClusterSize() const
Get cluster size.
SET_VALUE m_setEta
Pointer to setter functions.
bool isEMSampling(const sampling_type &theSampling) const
Checks if cells from a given sampling in EMB and EMEC are in the cluster.
bool hasSampling(const sampling_type &theSampling) const
Checks if certain sampling contributes to cluster.
unsigned int getClusterPhiSize() const
bool setStores(CaloShower *pData, CaloCellLink *pLink, bool ownStores=true)
Setup internal store.
void setPhiInSamples(const std::vector< double > &thePhis)
Set in all samplings from a vector.
bool setDataLink(CaloShowerContainer *pDataLink)
Set element link for shower data.
moment_store::moment_value moment_value
Cluster moment value type.
double(CaloCluster::* GET_VALUE)() const
double m_posNorm
Stores the normalization e.g.
CaloClusterMomentStore * getMomentStore(bool useLink=true)
GET_VALUE m_getPhi
Pointer to getter functions.
double value_type
Variable value type.
virtual double phi() const
Retrieve phi independent of signal state.
bool allLocked() const
Check if all variables are locked.
double getRawE() const
Access to raw energy.
CaloClusterMomentStore moment_store
Store type for cluster moments.
static const double m_errorValue
Internal error return for real numbers.
void setenergymax(sampling_type sampling, double m)
Set the maximum energy in a given sampling.
void setphisize(sampling_type sampling, double size)
Set the cluster size in for a given sampling.
CaloSamplingData m_dataStore
{\ brief Cached Stores
virtual void updateKine(const CaloCell *theCell, double weight)
Updates cluster kinematics when cell is added.
virtual void setBasicEnergy(double theEnergy)
Set basic energy scale signal.
moment_store::moment_type moment_type
Cluster moment indicator type.
GET_VALUE m_getEta
Pointer to getter functions.
GET_VALUE m_getM
Pointer to getter functions.
void setAltPhi(double phi)
Set calibrated (cell weight) phi.
unsigned int m_clusterSize
Cluster size (e.g.
void setCalEta(double eta)
Set calibrated (LC) eta.
void getPhiInSamples(std::vector< double > &thePhis) const
Retrieve for all samplings into a vector.
CaloSampling::CaloSample sampling_type
Sampling indicator.
void setphi(sampling_type sampling, double phi)
Set in a given sampling.
double phi0() const
Returns raw of cluster seed.
int m_nBarrel
Counter for number of barrel cells with non-zero weight and energy.
void setAltM(double m)
Set calibrated (cell weight) m.
signalstate_t signalState() const
Retrieve signal state.
void setetasize(sampling_type sampling, double size)
Set the cluster size in for a given sampling.
bool m_barrel
Flag is true if at least one cell in EMB.
virtual void setPhi(double phi)
Set phi.
unsigned int nSamples() const
Retrieve number of samplings in this cluster.
virtual void setM(double m)
Set mass.
GET_VALUE m_getE
Pointer to getter functions.
double m_altEta
Stores calibrated (cell weight) signal.
double m_basicSignal
Stores basic energy signal.
unsigned int m_lockPattern
Variable lock pattern.
void(CaloCluster::* SET_VALUE)(double v)
void setAltEta(double eta)
Set calibrated (cell weight) eta.
bool inBarrel() const
Returns true if at least one clustered cell in EMB.
virtual void setE(double e)
Set energy.
NAV::object_iter cell_iterator
Iterator type for cell store.
Simple data object to store all variables in calorimeter samplings.
static bool isEMSampling(const CaloSample &rSample)
Get sampling characteristics.
static unsigned int getSamplingBit(const CaloSample &rSample)
Return a unique bit set for a given sampling.
static constexpr unsigned int getNumberOfSamplings()
Get number of available samplings.
Container class for CaloShower.
Data class for cluster variables associated with a CaloCluster.
Definition CaloShower.h:12
I4Momentum is an abstract base class providing 4-momentum behavior.
Definition I4Momentum.h:31
virtual CLHEP::HepLorentzVector hlv() const =0
CLHEP HepLorentzVector.
virtual double m() const =0
mass
virtual double phi() const =0
phi in [-pi,pi[
virtual double p() const =0
momentum magnitude
virtual double eta() const =0
pseudo rapidity
virtual double e() const =0
energy
ISignalState is an abstract base class providing support for various Signal States to be associated w...
virtual double e() const
get energy data member
Definition P4EEtaPhiM.h:102
virtual double phi() const
get phi data member
Definition P4EEtaPhiM.h:108
virtual double eta() const
get eta data member
Definition P4EEtaPhiM.h:105
virtual double m() const
get mass data member
Definition P4EEtaPhiM.h:111
static bool setLink(CONT *pCont, DOBJ *pDat, ELEM &rElm)
static unsigned int getVariableBit(const VariableType &varType)
static unsigned int getAllVariableBits()