CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
CaloTowersCreationAlgo Class Reference

#include <CaloTowersCreationAlgo.h>

Classes

struct  MetaTower
 

Public Member Functions

void begin ()
 
 CaloTowersCreationAlgo ()
 
 CaloTowersCreationAlgo (double EBthreshold, double EEthreshold, bool useEtEBTreshold, bool useEtEETreshold, bool useSymEBTreshold, bool useSymEETreshold, double HcalThreshold, double HBthreshold, double HBthreshold1, double HBthreshold2, double HESthreshold, double HESthreshold1, double HEDthreshold, double HEDthreshold1, double HOthreshold0, double HOthresholdPlus1, double HOthresholdMinus1, double HOthresholdPlus2, double HOthresholdMinus2, double HF1threshold, double HF2threshold, double EBweight, double EEweight, double HBweight, double HESweight, double HEDweight, double HOweight, double HF1weight, double HF2weight, double EcutTower, double EBSumThreshold, double EESumThreshold, bool useHO, int momConstrMethod, double momHBDepth, double momHEDepth, double momEBDepth, double momEEDepth, int hcalPhase=0)
 
 CaloTowersCreationAlgo (double EBthreshold, double EEthreshold, bool useEtEBTreshold, bool useEtEETreshold, bool useSymEBTreshold, bool useSymEETreshold, double HcalThreshold, double HBthreshold, double HBthreshold1, double HBthreshold2, double HESthreshold, double HESthreshold1, double HEDthreshold, double HEDthreshold1, double HOthreshold0, double HOthresholdPlus1, double HOthresholdMinus1, double HOthresholdPlus2, double HOthresholdMinus2, double HF1threshold, double HF2threshold, const std::vector< double > &EBGrid, const std::vector< double > &EBWeights, const std::vector< double > &EEGrid, const std::vector< double > &EEWeights, const std::vector< double > &HBGrid, const std::vector< double > &HBWeights, const std::vector< double > &HESGrid, const std::vector< double > &HESWeights, const std::vector< double > &HEDGrid, const std::vector< double > &HEDWeights, const std::vector< double > &HOGrid, const std::vector< double > &HOWeights, const std::vector< double > &HF1Grid, const std::vector< double > &HF1Weights, const std::vector< double > &HF2Grid, const std::vector< double > &HF2Weights, double EBweight, double EEweight, double HBweight, double HESweight, double HEDweight, double HOweight, double HF1weight, double HF2weight, double EcutTower, double EBSumThreshold, double EESumThreshold, bool useHO, int momConstrMethod, double momHBDepth, double momHEDepth, double momEBDepth, double momEEDepth, int hcalPhase=0)
 
std::tuple< unsigned int, bool > ecalChanStatusForCaloTower (const EcalRecHit *hit)
 
GlobalPoint emCrystalShwrPos (DetId detId, float fracDepth)
 
GlobalPoint emShwrLogWeightPos (const std::vector< std::pair< DetId, float >> &metaContains, float fracDepth, double totEmE)
 
GlobalPoint emShwrPos (const std::vector< std::pair< DetId, float >> &metaContains, float fracDepth, double totEmE)
 
void finish (CaloTowerCollection &destCollection)
 
GlobalPoint hadSegmentShwrPos (DetId detId, float fracDepth)
 
GlobalPoint hadShwPosFromCells (DetId frontCell, DetId backCell, float fracDepth)
 
GlobalPoint hadShwrPos (const std::vector< std::pair< DetId, float >> &metaContains, float fracDepth, double hadE)
 
GlobalPoint hadShwrPos (CaloTowerDetId id, float fracDepth)
 
unsigned int hcalChanStatusForCaloTower (const CaloRecHit *hit)
 
void makeEcalBadChs ()
 
void makeHcalDropChMap ()
 
void process (const HBHERecHitCollection &hbhe)
 
void process (const HORecHitCollection &ho)
 
void process (const HFRecHitCollection &hf)
 
void process (const EcalRecHitCollection &ecal)
 
void process (const CaloTowerCollection &ctc)
 
void rescaleTowers (const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
 
void setEBEScale (double scale)
 
void setEbHandle (const edm::Handle< EcalRecHitCollection > eb)
 
void setEcalChStatusFromDB (const EcalChannelStatus *s)
 
void setEcalSeveritiesToBeExcluded (const std::vector< int > &ecalSev)
 
void SetEcalSeveritiesToBeUsedInBadTowers (const std::vector< int > &ecalSev)
 
void setEcalSevLvlAlgo (const EcalSeverityLevelAlgo *a)
 
void setEEEScale (double scale)
 
void setEeHandle (const edm::Handle< EcalRecHitCollection > ee)
 
void setGeometry (const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
 
void setHBEScale (double scale)
 
void setHcalAcceptSeverityLevel (unsigned int level)
 
void setHcalAcceptSeverityLevelForRejectedHit (unsigned int level)
 
void setHcalChStatusFromDB (const HcalChannelQuality *s)
 
void setHcalSevLvlComputer (const HcalSeverityLevelComputer *c)
 
void setHEDEScale (double scale)
 
void setHESEScale (double scale)
 
void setHF1EScale (double scale)
 
void setHF2EScale (double scale)
 
void setHOEScale (double scale)
 
void setMissingHcalRescaleFactorForEcal (float factor)
 
void setRecoveredEcalHitsAreUsed (bool flag)
 
void setRecoveredHcalHitsAreUsed (bool flag)
 
void setThresFromDB (const HcalPFCuts *cuts)
 
void setUseRejectedHitsOnly (bool flag)
 
void setUseRejectedRecoveredEcalHits (bool flag)
 
void setUseRejectedRecoveredHcalHits (bool flag)
 

Public Attributes

int nalgo = -1
 

Private Types

enum  ctHitCategory {
  GoodChan = 0, BadChan = 1, RecoveredChan = 2, ProblematicChan = 3,
  IgnoredChan = 99
}
 
typedef std::map< CaloTowerDetId, std::pair< short int, bool > > HcalDropChMap
 
typedef std::vector< MetaTowerMetaTowerMap
 

Private Member Functions

void assignHitEcal (const EcalRecHit *recHit)
 adds a single hit to the tower More...
 
void assignHitHcal (const CaloRecHit *recHit)
 
int compactTime (float time)
 
void convert (const CaloTowerDetId &id, const MetaTower &mt, CaloTowerCollection &collection)
 
MetaTowerfind (const CaloTowerDetId &id)
 looks for a given tower in the internal cache. If it can't find it, it makes it. More...
 
void getThresholdAndWeight (const DetId &detId, double &threshold, double &weight) const
 helper method to look up the appropriate threshold & weight More...
 
void rescale (const CaloTower *ct)
 

Private Attributes

std::vector< unsigned short > ecalBadChs
 
const HcalPFCutshcalCuts
 
HcalDropChMap hcalDropChMap
 
std::vector< HcalDetIdids_
 
float missingHcalRescaleFactorForEcal
 
double theEBEScale
 
std::vector< double > theEBGrid
 
edm::Handle< EcalRecHitCollectiontheEbHandle
 
double theEBSumThreshold
 
double theEBthreshold
 
double theEBweight
 
std::vector< double > theEBWeights
 
const EcalChannelStatustheEcalChStatus
 
std::vector< int > theEcalSeveritiesToBeExcluded
 
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers
 
const EcalSeverityLevelAlgotheEcalSevLvlAlgo
 
double theEcutTower
 
double theEEEScale
 
std::vector< double > theEEGrid
 
edm::Handle< EcalRecHitCollectiontheEeHandle
 
double theEESumThreshold
 
double theEEthreshold
 
double theEEweight
 
std::vector< double > theEEWeights
 
const CaloGeometrytheGeometry
 
double theHBEScale
 
std::vector< double > theHBGrid
 
double theHBthreshold
 
double theHBthreshold1
 
double theHBthreshold2
 
double theHBweight
 
std::vector< double > theHBWeights
 
unsigned int theHcalAcceptSeverityLevel
 
unsigned int theHcalAcceptSeverityLevelForRejectedHit
 
const HcalChannelQualitytheHcalChStatus
 
int theHcalPhase
 
const HcalSeverityLevelComputertheHcalSevLvlComputer
 
double theHcalThreshold
 
const HcalTopologytheHcalTopology
 
double theHEDEScale
 
std::vector< double > theHEDGrid
 
double theHEDthreshold
 
double theHEDthreshold1
 
double theHEDweight
 
std::vector< double > theHEDWeights
 
double theHESEScale
 
std::vector< double > theHESGrid
 
double theHESthreshold
 
double theHESthreshold1
 
double theHESweight
 
std::vector< double > theHESWeights
 
double theHF1EScale
 
std::vector< double > theHF1Grid
 
double theHF1threshold
 
double theHF1weight
 
std::vector< double > theHF1Weights
 
double theHF2EScale
 
std::vector< double > theHF2Grid
 
double theHF2threshold
 
double theHF2weight
 
std::vector< double > theHF2Weights
 
double theHOEScale
 
std::vector< double > theHOGrid
 
bool theHOIsUsed
 only affects energy and ET calculation. HO is still recorded in the tower More...
 
double theHOthreshold0
 
double theHOthresholdMinus1
 
double theHOthresholdMinus2
 
double theHOthresholdPlus1
 
double theHOthresholdPlus2
 
double theHOweight
 
std::vector< double > theHOWeights
 
int theMomConstrMethod
 
double theMomEBDepth
 
double theMomEEDepth
 
double theMomHBDepth
 
double theMomHEDepth
 
bool theRecoveredEcalHitsAreUsed
 
bool theRecoveredHcalHitsAreUsed
 
const CaloTowerConstituentsMaptheTowerConstituentsMap
 
const CaloSubdetectorGeometrytheTowerGeometry
 
MetaTowerMap theTowerMap
 
unsigned int theTowerMapSize = 0
 
const CaloTowerTopologytheTowerTopology
 
bool theUseEtEBTresholdFlag
 
bool theUseEtEETresholdFlag
 
bool theUseSymEBTresholdFlag
 
bool theUseSymEETresholdFlag
 
bool useRejectedHitsOnly
 
unsigned int useRejectedRecoveredEcalHits
 
unsigned int useRejectedRecoveredHcalHits
 

Detailed Description

Author
R. Wilkinson - Caltech

Definition at line 52 of file CaloTowersCreationAlgo.h.

Member Typedef Documentation

◆ HcalDropChMap

typedef std::map<CaloTowerDetId, std::pair<short int, bool> > CaloTowersCreationAlgo::HcalDropChMap
private

Definition at line 386 of file CaloTowersCreationAlgo.h.

◆ MetaTowerMap

typedef std::vector<MetaTower> CaloTowersCreationAlgo::MetaTowerMap
private

Definition at line 380 of file CaloTowersCreationAlgo.h.

Member Enumeration Documentation

◆ ctHitCategory

Constructor & Destructor Documentation

◆ CaloTowersCreationAlgo() [1/3]

CaloTowersCreationAlgo::CaloTowersCreationAlgo ( )

Definition at line 16 of file CaloTowersCreationAlgo.cc.

17  : theEBthreshold(-1000.),
18  theEEthreshold(-1000.),
19 
24 
25  theHcalThreshold(-1000.),
26  theHBthreshold(-1000.),
27  theHBthreshold1(-1000.),
28  theHBthreshold2(-1000.),
29  theHESthreshold(-1000.),
30  theHESthreshold1(-1000.),
31  theHEDthreshold(-1000.),
32  theHEDthreshold1(-1000.),
33  theHOthreshold0(-1000.),
34  theHOthresholdPlus1(-1000.),
35  theHOthresholdMinus1(-1000.),
36  theHOthresholdPlus2(-1000.),
37  theHOthresholdMinus2(-1000.),
38  theHF1threshold(-1000.),
39  theHF2threshold(-1000.),
40  theEBGrid(std::vector<double>(5, 10.)),
41  theEBWeights(std::vector<double>(5, 1.)),
42  theEEGrid(std::vector<double>(5, 10.)),
43  theEEWeights(std::vector<double>(5, 1.)),
44  theHBGrid(std::vector<double>(5, 10.)),
45  theHBWeights(std::vector<double>(5, 1.)),
46  theHESGrid(std::vector<double>(5, 10.)),
47  theHESWeights(std::vector<double>(5, 1.)),
48  theHEDGrid(std::vector<double>(5, 10.)),
49  theHEDWeights(std::vector<double>(5, 1.)),
50  theHOGrid(std::vector<double>(5, 10.)),
51  theHOWeights(std::vector<double>(5, 1.)),
52  theHF1Grid(std::vector<double>(5, 10.)),
53  theHF1Weights(std::vector<double>(5, 1.)),
54  theHF2Grid(std::vector<double>(5, 10.)),
55  theHF2Weights(std::vector<double>(5, 1.)),
56  theEBweight(1.),
57  theEEweight(1.),
58  theHBweight(1.),
59  theHESweight(1.),
60  theHEDweight(1.),
61  theHOweight(1.),
62  theHF1weight(1.),
63  theHF2weight(1.),
64  theEcutTower(-1000.),
65  theEBSumThreshold(-1000.),
66  theEESumThreshold(-1000.),
67  theEBEScale(50.),
68  theEEEScale(50.),
69  theHBEScale(50.),
70  theHESEScale(50.),
71  theHEDEScale(50.),
72  theHOEScale(50.),
73  theHF1EScale(50.),
74  theHF2EScale(50.),
75  theHcalTopology(nullptr),
76  theGeometry(nullptr),
77  theTowerConstituentsMap(nullptr),
81  useRejectedHitsOnly(false),
86  theHOIsUsed(true),
87  // (for momentum reconstruction algorithm)
89  theMomHBDepth(0.),
90  theMomHEDepth(0.),
91  theMomEBDepth(0.),
92  theMomEEDepth(0.),
93  theHcalPhase(0) {}
std::vector< double > theHBGrid
std::vector< double > theHESGrid
std::vector< double > theHEDGrid
std::vector< double > theHOWeights
std::vector< double > theEEGrid
std::vector< double > theEEWeights
std::vector< double > theHESWeights
std::vector< double > theHF2Grid
std::vector< double > theHEDWeights
const CaloGeometry * theGeometry
std::vector< double > theHOGrid
const CaloTowerConstituentsMap * theTowerConstituentsMap
std::vector< double > theHF1Weights
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
std::vector< double > theHBWeights
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
unsigned int theHcalAcceptSeverityLevelForRejectedHit
std::vector< double > theEBWeights

◆ CaloTowersCreationAlgo() [2/3]

CaloTowersCreationAlgo::CaloTowersCreationAlgo ( double  EBthreshold,
double  EEthreshold,
bool  useEtEBTreshold,
bool  useEtEETreshold,
bool  useSymEBTreshold,
bool  useSymEETreshold,
double  HcalThreshold,
double  HBthreshold,
double  HBthreshold1,
double  HBthreshold2,
double  HESthreshold,
double  HESthreshold1,
double  HEDthreshold,
double  HEDthreshold1,
double  HOthreshold0,
double  HOthresholdPlus1,
double  HOthresholdMinus1,
double  HOthresholdPlus2,
double  HOthresholdMinus2,
double  HF1threshold,
double  HF2threshold,
double  EBweight,
double  EEweight,
double  HBweight,
double  HESweight,
double  HEDweight,
double  HOweight,
double  HF1weight,
double  HF2weight,
double  EcutTower,
double  EBSumThreshold,
double  EESumThreshold,
bool  useHO,
int  momConstrMethod,
double  momHBDepth,
double  momHEDepth,
double  momEBDepth,
double  momEEDepth,
int  hcalPhase = 0 
)

Definition at line 95 of file CaloTowersCreationAlgo.cc.

138  : theEBthreshold(EBthreshold),
139  theEEthreshold(EEthreshold),
140 
141  theUseEtEBTresholdFlag(useEtEBTreshold),
142  theUseEtEETresholdFlag(useEtEETreshold),
143  theUseSymEBTresholdFlag(useSymEBTreshold),
144  theUseSymEETresholdFlag(useSymEETreshold),
145 
147  theHBthreshold(HBthreshold),
148  theHBthreshold1(HBthreshold1),
149  theHBthreshold2(HBthreshold2),
150  theHESthreshold(HESthreshold),
151  theHESthreshold1(HESthreshold1),
152  theHEDthreshold(HEDthreshold),
153  theHEDthreshold1(HEDthreshold1),
154  theHOthreshold0(HOthreshold0),
155  theHOthresholdPlus1(HOthresholdPlus1),
156  theHOthresholdMinus1(HOthresholdMinus1),
157  theHOthresholdPlus2(HOthresholdPlus2),
158  theHOthresholdMinus2(HOthresholdMinus2),
159  theHF1threshold(HF1threshold),
160  theHF2threshold(HF2threshold),
161  theEBGrid(std::vector<double>(5, 10.)),
162  theEBWeights(std::vector<double>(5, 1.)),
163  theEEGrid(std::vector<double>(5, 10.)),
164  theEEWeights(std::vector<double>(5, 1.)),
165  theHBGrid(std::vector<double>(5, 10.)),
166  theHBWeights(std::vector<double>(5, 1.)),
167  theHESGrid(std::vector<double>(5, 10.)),
168  theHESWeights(std::vector<double>(5, 1.)),
169  theHEDGrid(std::vector<double>(5, 10.)),
170  theHEDWeights(std::vector<double>(5, 1.)),
171  theHOGrid(std::vector<double>(5, 10.)),
172  theHOWeights(std::vector<double>(5, 1.)),
173  theHF1Grid(std::vector<double>(5, 10.)),
174  theHF1Weights(std::vector<double>(5, 1.)),
175  theHF2Grid(std::vector<double>(5, 10.)),
176  theHF2Weights(std::vector<double>(5, 1.)),
177  theEBweight(EBweight),
178  theEEweight(EEweight),
179  theHBweight(HBweight),
180  theHESweight(HESweight),
181  theHEDweight(HEDweight),
182  theHOweight(HOweight),
183  theHF1weight(HF1weight),
184  theHF2weight(HF2weight),
188  theEBEScale(50.),
189  theEEEScale(50.),
190  theHBEScale(50.),
191  theHESEScale(50.),
192  theHEDEScale(50.),
193  theHOEScale(50.),
194  theHF1EScale(50.),
195  theHF2EScale(50.),
196  theHcalTopology(nullptr),
197  theGeometry(nullptr),
198  theTowerConstituentsMap(nullptr),
202  useRejectedHitsOnly(false),
208  // (momentum reconstruction algorithm)
209  theMomConstrMethod(momConstrMethod),
210  theMomHBDepth(momHBDepth),
211  theMomHEDepth(momHEDepth),
212  theMomEBDepth(momEBDepth),
213  theMomEEDepth(momEEDepth),
214  theHcalPhase(hcalPhase) {}
std::vector< double > theHBGrid
std::vector< double > theHESGrid
std::vector< double > theHEDGrid
std::vector< double > theHOWeights
std::vector< double > theEEGrid
std::vector< double > theEEWeights
std::vector< double > theHESWeights
std::vector< double > theHF2Grid
std::vector< double > theHEDWeights
const CaloGeometry * theGeometry
std::vector< double > theHOGrid
const CaloTowerConstituentsMap * theTowerConstituentsMap
std::vector< double > theHF1Weights
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
std::vector< double > theHBWeights
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
unsigned int theHcalAcceptSeverityLevelForRejectedHit
std::vector< double > theEBWeights

◆ CaloTowersCreationAlgo() [3/3]

CaloTowersCreationAlgo::CaloTowersCreationAlgo ( double  EBthreshold,
double  EEthreshold,
bool  useEtEBTreshold,
bool  useEtEETreshold,
bool  useSymEBTreshold,
bool  useSymEETreshold,
double  HcalThreshold,
double  HBthreshold,
double  HBthreshold1,
double  HBthreshold2,
double  HESthreshold,
double  HESthreshold1,
double  HEDthreshold,
double  HEDthreshold1,
double  HOthreshold0,
double  HOthresholdPlus1,
double  HOthresholdMinus1,
double  HOthresholdPlus2,
double  HOthresholdMinus2,
double  HF1threshold,
double  HF2threshold,
const std::vector< double > &  EBGrid,
const std::vector< double > &  EBWeights,
const std::vector< double > &  EEGrid,
const std::vector< double > &  EEWeights,
const std::vector< double > &  HBGrid,
const std::vector< double > &  HBWeights,
const std::vector< double > &  HESGrid,
const std::vector< double > &  HESWeights,
const std::vector< double > &  HEDGrid,
const std::vector< double > &  HEDWeights,
const std::vector< double > &  HOGrid,
const std::vector< double > &  HOWeights,
const std::vector< double > &  HF1Grid,
const std::vector< double > &  HF1Weights,
const std::vector< double > &  HF2Grid,
const std::vector< double > &  HF2Weights,
double  EBweight,
double  EEweight,
double  HBweight,
double  HESweight,
double  HEDweight,
double  HOweight,
double  HF1weight,
double  HF2weight,
double  EcutTower,
double  EBSumThreshold,
double  EESumThreshold,
bool  useHO,
int  momConstrMethod,
double  momHBDepth,
double  momHEDepth,
double  momEBDepth,
double  momEEDepth,
int  hcalPhase = 0 
)

Definition at line 216 of file CaloTowersCreationAlgo.cc.

274  : theEBthreshold(EBthreshold),
275  theEEthreshold(EEthreshold),
276 
277  theUseEtEBTresholdFlag(useEtEBTreshold),
278  theUseEtEETresholdFlag(useEtEETreshold),
279  theUseSymEBTresholdFlag(useSymEBTreshold),
280  theUseSymEETresholdFlag(useSymEETreshold),
281 
283  theHBthreshold(HBthreshold),
284  theHBthreshold1(HBthreshold1),
285  theHBthreshold2(HBthreshold2),
286  theHESthreshold(HESthreshold),
287  theHESthreshold1(HESthreshold1),
288  theHEDthreshold(HEDthreshold),
289  theHEDthreshold1(HEDthreshold1),
290  theHOthreshold0(HOthreshold0),
291  theHOthresholdPlus1(HOthresholdPlus1),
292  theHOthresholdMinus1(HOthresholdMinus1),
293  theHOthresholdPlus2(HOthresholdPlus2),
294  theHOthresholdMinus2(HOthresholdMinus2),
295  theHF1threshold(HF1threshold),
296  theHF2threshold(HF2threshold),
297  theEBGrid(EBGrid),
299  theEEGrid(EEGrid),
301  theHBGrid(HBGrid),
307  theHOGrid(HOGrid),
313  theEBweight(EBweight),
314  theEEweight(EEweight),
315  theHBweight(HBweight),
316  theHESweight(HESweight),
317  theHEDweight(HEDweight),
318  theHOweight(HOweight),
319  theHF1weight(HF1weight),
320  theHF2weight(HF2weight),
324  theEBEScale(50.),
325  theEEEScale(50.),
326  theHBEScale(50.),
327  theHESEScale(50.),
328  theHEDEScale(50.),
329  theHOEScale(50.),
330  theHF1EScale(50.),
331  theHF2EScale(50.),
332  theHcalTopology(nullptr),
333  theGeometry(nullptr),
334  theTowerConstituentsMap(nullptr),
338  useRejectedHitsOnly(false),
344  // (momentum reconstruction algorithm)
345  theMomConstrMethod(momConstrMethod),
346  theMomHBDepth(momHBDepth),
347  theMomHEDepth(momHEDepth),
348  theMomEBDepth(momEBDepth),
349  theMomEEDepth(momEEDepth),
350  theHcalPhase(hcalPhase) {
351  // static int N = 0;
352  // std::cout << "VI Algo " << ++N << std::endl;
353  // nalgo=N;
354 }
std::vector< double > theHBGrid
std::vector< double > theHESGrid
std::vector< double > theHEDGrid
std::vector< double > theHOWeights
std::vector< double > theEEGrid
std::vector< double > theEEWeights
std::vector< double > theHESWeights
std::vector< double > theHF2Grid
std::vector< double > theHEDWeights
const CaloGeometry * theGeometry
std::vector< double > theHOGrid
const CaloTowerConstituentsMap * theTowerConstituentsMap
std::vector< double > theHF1Weights
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
std::vector< double > theHBWeights
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
unsigned int theHcalAcceptSeverityLevelForRejectedHit
std::vector< double > theEBWeights

Member Function Documentation

◆ assignHitEcal()

void CaloTowersCreationAlgo::assignHitEcal ( const EcalRecHit recHit)
private

adds a single hit to the tower

Definition at line 776 of file CaloTowersCreationAlgo.cc.

References BadChan, hcalRecHitTable_cff::detId, MillePedeFileConverter_cfg::e, EcalBarrel, ecalChanStatusForCaloTower(), EcalEndcap, hcalRecHitTable_cff::energy, PVValHelper::eta, spr::find(), find(), CaloGeometry::getGeometry(), getThresholdAndWeight(), GoodChan, IgnoredChan, CaloTowersParam_cfi::mc, DetId::null(), ProblematicChan, rpcPointValidation_cfi::recHit, RecoveredChan, EcalSeverityLevelAlgo::severityLevel(), theEcalSeveritiesToBeExcluded, theEcalSevLvlAlgo, theGeometry, theTowerConstituentsMap, theUseEtEBTresholdFlag, theUseEtEETresholdFlag, theUseSymEBTresholdFlag, theUseSymEETresholdFlag, DiMuonV_cfg::threshold, l1tHGCalTowerProducer_cfi::tower, CaloTowerConstituentsMap::towerOf(), and mps_merge::weight.

Referenced by process().

776  {
777  DetId detId = recHit->detid();
778 
779  unsigned int chStatusForCT;
780  bool ecalIsBad = false;
781  std::tie(chStatusForCT, ecalIsBad) = ecalChanStatusForCaloTower(recHit);
782 
783  // this is for skipping channls: mostly needed for the creation of
784  // bad towers from hits i the bad channel collections.
785  if (chStatusForCT == CaloTowersCreationAlgo::IgnoredChan)
786  return;
787 
788  double threshold, weight;
790 
791  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
792  double e = energy * weight; // energies scaled by user weight: used in energy assignments
793 
795 
796  // For ECAL we count all bad channels after the metatower is complete
797 
798  // Include options for symmetric thresholds and cut on Et
799  // for ECAL RecHits
800 
801  bool passEmThreshold = false;
802 
803  if (detId.subdetId() == EcalBarrel) {
805  energy /= cosh((theGeometry->getGeometry(detId)->getPosition()).eta());
807  passEmThreshold = (fabs(energy) >= threshold);
808  else
809  passEmThreshold = (energy >= threshold);
810 
811  } else if (detId.subdetId() == EcalEndcap) {
813  energy /= cosh((theGeometry->getGeometry(detId)->getPosition()).eta());
815  passEmThreshold = (fabs(energy) >= threshold);
816  else
817  passEmThreshold = (energy >= threshold);
818  }
819 
821  if (towerDetId.null())
822  return;
823  MetaTower& tower = find(towerDetId);
824 
825  // count bad cells and avoid double counting with those from DB (Recovered are counted bad)
826 
827  // somehow misses some
828  // if ( (chStatusForCT == CaloTowersCreationAlgo::BadChan) & (!ecalIsBad) ) ++tower.numBadEcalCells;
829 
830  // a bit slower...
831  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
832  auto thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel(detId);
833  // check if the Ecal severity is ok to keep
834  auto sevit = std::find(theEcalSeveritiesToBeExcluded.begin(), theEcalSeveritiesToBeExcluded.end(), thisEcalSevLvl);
835  if (sevit == theEcalSeveritiesToBeExcluded.end())
836  ++tower.numBadEcalCells; // notinDB
837  }
838 
839  // if (chStatusForCT != CaloTowersCreationAlgo::BadChan && energy >= threshold) {
840  if (chStatusForCT != CaloTowersCreationAlgo::BadChan && passEmThreshold) {
841  tower.E_em += e;
842  tower.E += e;
843 
844  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
845  tower.numRecEcalCells += 1;
846  } else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
847  tower.numProbEcalCells += 1;
848  }
849 
850  // change when full status info is available
851  // for now use only good channels
852 
853  // add e>0 check (new options allow e<0)
854  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan && e > 0) {
855  tower.emSumTimeTimesE += (e * recHit->time());
856  tower.emSumEForTime += e; // see above
857  }
858 
859  std::pair<DetId, float> mc(detId, e);
860  tower.metaConstituents.push_back(mc);
861  }
862 } // end of assignHitEcal method
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold & weight
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
Definition: weight.py:1
MetaTower & find(const CaloTowerDetId &id)
looks for a given tower in the internal cache. If it can&#39;t find it, it makes it.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
const CaloGeometry * theGeometry
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
const CaloTowerConstituentsMap * theTowerConstituentsMap
Definition: DetId.h:17
std::vector< int > theEcalSeveritiesToBeExcluded
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
std::tuple< unsigned int, bool > ecalChanStatusForCaloTower(const EcalRecHit *hit)

◆ assignHitHcal()

void CaloTowersCreationAlgo::assignHitHcal ( const CaloRecHit recHit)
private

Definition at line 538 of file CaloTowersCreationAlgo.cc.

References BadChan, gather_cfg::cout, HcalDetId::depth(), DetId::det(), hcalRecHitTable_cff::detId, MillePedeFileConverter_cfg::e, CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_had, CaloTowersCreationAlgo::MetaTower::E_outer, hcalRecHitTable_cff::energy, find(), HcalTopology::getMergePositionFlag(), getThresholdAndWeight(), GoodChan, CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalChanStatusForCaloTower(), HcalEndcap, HcalForward, HcalOuter, HcalTopology::idFront(), CaloTowerDetId::ieta(), HcalDetId::ietaAbs(), IgnoredChan, CaloTowerDetId::iphi(), HcalTopology::lastHERing(), CaloTowersParam_cfi::mc, merge(), HcalTopology::mergedDepth29(), CaloTowersCreationAlgo::MetaTower::metaConstituents, DetId::null(), CaloTowersCreationAlgo::MetaTower::numBadHcalCells, CaloTowersCreationAlgo::MetaTower::numProbHcalCells, CaloTowersCreationAlgo::MetaTower::numRecHcalCells, ProblematicChan, rpcPointValidation_cfi::recHit, RecoveredChan, HcalDetId::subdet(), theHcalPhase, theHcalTopology, theHOIsUsed, theTowerConstituentsMap, DiMuonV_cfg::threshold, l1tHGCalTowerProducer_cfi::tower, CaloTowerConstituentsMap::towerOf(), mps_merge::weight, and CaloTowerDetId::zside().

Referenced by process().

538  {
539  DetId detId = recHit->detid();
540  DetId detIdF(detId);
543 #ifdef EDM_ML_DEBUG
544  std::cout << "AssignHitHcal DetId " << HcalDetId(detId) << " Front " << HcalDetId(detIdF) << std::endl;
545 #endif
546  }
547 
548  unsigned int chStatusForCT = hcalChanStatusForCaloTower(recHit);
549 
550  // this is for skipping channls: mostly needed for the creation of
551  // bad towers from hits i the bad channel collections.
552  if (chStatusForCT == CaloTowersCreationAlgo::IgnoredChan)
553  return;
554 
555  double threshold, weight;
557 
558  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
559  double e = energy * weight; // energies scaled by user weight: used in energy assignments
560 
561  // SPECIAL handling of tower 28 merged depths --> half into tower 28 and half into tower 29
562  bool merge(false);
563  if (detIdF.det() == DetId::Hcal && HcalDetId(detIdF).subdet() == HcalEndcap &&
564  (theHcalPhase == 0 || theHcalPhase == 1) &&
565  //HcalDetId(detId).depth()==3 &&
566  HcalDetId(detIdF).ietaAbs() == theHcalTopology->lastHERing() - 1) {
568 #ifdef EDM_ML_DEBUG
569  std::cout << "Merge " << HcalDetId(detIdF) << ":" << merge << std::endl;
570 #endif
571  }
572  if (merge) {
574 
575  // bad channels are counted regardless of energy threshold
576 
577  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
579  if (towerDetId.null())
580  return;
581  MetaTower& tower28 = find(towerDetId);
582  CaloTowerDetId towerDetId29(towerDetId.ieta() + towerDetId.zside(), towerDetId.iphi());
583  MetaTower& tower29 = find(towerDetId29);
584  tower28.numBadHcalCells += 1;
585  tower29.numBadHcalCells += 1;
586  }
587 
588  else if (0.5 * energy >= threshold) { // not bad channel: use energy if above threshold
589 
591  if (towerDetId.null())
592  return;
593  MetaTower& tower28 = find(towerDetId);
594  CaloTowerDetId towerDetId29(towerDetId.ieta() + towerDetId.zside(), towerDetId.iphi());
595  MetaTower& tower29 = find(towerDetId29);
596 
597  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
598  tower28.numRecHcalCells += 1;
599  tower29.numRecHcalCells += 1;
600  } else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
601  tower28.numProbHcalCells += 1;
602  tower29.numProbHcalCells += 1;
603  }
604 
605  // NOTE DIVIDE BY 2!!!
606  double e28 = 0.5 * e;
607  double e29 = 0.5 * e;
608 
609  tower28.E_had += e28;
610  tower28.E += e28;
611  std::pair<DetId, float> mc(detId, e28);
612  tower28.metaConstituents.push_back(mc);
613 
614  tower29.E_had += e29;
615  tower29.E += e29;
616  tower29.metaConstituents.push_back(mc);
617 
618  // time info: do not use in averaging if timing error is found: need
619  // full set of status info to implement: use only "good" channels for now
620 
621  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
622  tower28.hadSumTimeTimesE += (e28 * recHit->time());
623  tower28.hadSumEForTime += e28;
624  tower29.hadSumTimeTimesE += (e29 * recHit->time());
625  tower29.hadSumEForTime += e29;
626  }
627 
628  // store the energy in layer 3 also in E_outer
629  tower28.E_outer += e28;
630  tower29.E_outer += e29;
631  } // not a "bad" hit
632  } // end of special case
633 
634  else {
635  HcalDetId hcalDetId(detId);
636 
638 
639  if (hcalDetId.subdet() == HcalOuter) {
641  if (towerDetId.null())
642  return;
643  MetaTower& tower = find(towerDetId);
644 
645  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
646  if (theHOIsUsed)
647  tower.numBadHcalCells += 1;
648  }
649 
650  else if (energy >= threshold) {
651  tower.E_outer += e; // store HO energy even if HO is not used
652  // add energy of the tower and/or flag if theHOIsUsed
653  if (theHOIsUsed) {
654  tower.E += e;
655 
656  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
657  tower.numRecHcalCells += 1;
658  } else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
659  tower.numProbHcalCells += 1;
660  }
661  } // HO is used
662 
663  // add HO to constituents even if it is not used: JetMET wants to keep these towers
664  std::pair<DetId, float> mc(detId, e);
665  tower.metaConstituents.push_back(mc);
666 
667  } // not a bad channel, energy above threshold
668 
669  } // HO hit
670 
671  // HF calculates EM fraction differently
672  else if (hcalDetId.subdet() == HcalForward) {
673  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
675  if (towerDetId.null())
676  return;
677  MetaTower& tower = find(towerDetId);
678  tower.numBadHcalCells += 1;
679  }
680 
681  else if (energy >= threshold) {
683  if (towerDetId.null())
684  return;
685  MetaTower& tower = find(towerDetId);
686 
687  if (hcalDetId.depth() == 1) {
688  // long fiber, so E_EM = E(Long) - E(Short)
689  tower.E_em += e;
690  } else {
691  // short fiber, EHAD = 2 * E(Short)
692  tower.E_em -= e;
693  tower.E_had += 2. * e;
694  }
695  tower.E += e;
696  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
697  tower.numRecHcalCells += 1;
698  } else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
699  tower.numProbHcalCells += 1;
700  }
701 
702  // put the timing in HCAL -> have to check timing errors when available
703  // for now use only good channels
704  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
705  tower.hadSumTimeTimesE += (e * recHit->time());
706  tower.hadSumEForTime += e;
707  }
708 
709  std::pair<DetId, float> mc(detId, e);
710  tower.metaConstituents.push_back(mc);
711 
712  } // not a bad HF channel, energy above threshold
713 
714  } // HF hit
715 
716  else {
717  // HCAL situation normal in HB/HE
718  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
720  if (towerDetId.null())
721  return;
722  MetaTower& tower = find(towerDetId);
723  tower.numBadHcalCells += 1;
724  } else if (energy >= threshold) {
726  if (towerDetId.null())
727  return;
728  MetaTower& tower = find(towerDetId);
729  tower.E_had += e;
730  tower.E += e;
731  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
732  tower.numRecHcalCells += 1;
733  } else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
734  tower.numProbHcalCells += 1;
735  }
736 
737  // Timing information: need specific accessors
738  // for now use only good channels
739  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
740  tower.hadSumTimeTimesE += (e * recHit->time());
741  tower.hadSumEForTime += e;
742  }
743  // store energy in highest depth for towers 18-27 (for electron,photon ID in endcap)
744  // also, store energy in HE part of tower 16 (for JetMET cleanup)
745  HcalDetId hcalDetId(detId);
746  if (hcalDetId.subdet() == HcalEndcap) {
747  if (theHcalPhase == 0) {
748  if ((hcalDetId.depth() == 2 && hcalDetId.ietaAbs() >= 18 && hcalDetId.ietaAbs() < 27) ||
749  (hcalDetId.depth() == 3 && hcalDetId.ietaAbs() == 27) ||
750  (hcalDetId.depth() == 3 && hcalDetId.ietaAbs() == 16)) {
751  tower.E_outer += e;
752  }
753  }
754  //combine depths in phase0-like way
755  else if (theHcalPhase == 1) {
756  if ((hcalDetId.depth() >= 3 && hcalDetId.ietaAbs() >= 18 && hcalDetId.ietaAbs() < 26) ||
757  (hcalDetId.depth() >= 4 && (hcalDetId.ietaAbs() == 26 || hcalDetId.ietaAbs() == 27)) ||
758  (hcalDetId.depth() == 3 && hcalDetId.ietaAbs() == 17) ||
759  (hcalDetId.depth() == 4 && hcalDetId.ietaAbs() == 16)) {
760  tower.E_outer += e;
761  }
762  }
763  }
764 
765  std::pair<DetId, float> mc(detId, e);
766  tower.metaConstituents.push_back(mc);
767 
768  } // not a "bad" channel, energy above threshold
769 
770  } // channel in HBHE (excluding twrs 28,29)
771 
772  } // recHit normal case (not in HE towers 28,29)
773 
774 } // end of assignHitHcal method
bool mergedDepth29(HcalDetId id) const
Definition: HcalTopology.h:111
Definition: merge.py:1
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
int merge(int argc, char *argv[])
Definition: DiMuonVmerge.cc:27
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold & weight
constexpr int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:148
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
Definition: weight.py:1
MetaTower & find(const CaloTowerDetId &id)
looks for a given tower in the internal cache. If it can&#39;t find it, it makes it.
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
unsigned int hcalChanStatusForCaloTower(const CaloRecHit *hit)
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
const CaloTowerConstituentsMap * theTowerConstituentsMap
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
Definition: DetId.h:17
int iphi() const
get the tower iphi
int ieta() const
get the tower ieta
const HcalTopology * theHcalTopology
int zside() const
get the z-side of the tower (1/-1)
int lastHERing() const
Definition: HcalTopology.h:94

◆ begin()

void CaloTowersCreationAlgo::begin ( void  )

Definition at line 372 of file CaloTowersCreationAlgo.cc.

References theTowerMap, and theTowerMapSize.

Referenced by CaloTowersReCreator::produce(), and CaloTowersCreator::produce().

372  {
373  theTowerMap.clear();
374  theTowerMapSize = 0;
375  //hcalDropChMap.clear();
376 }

◆ compactTime()

int CaloTowersCreationAlgo::compactTime ( float  time)
private

Definition at line 1651 of file CaloTowersCreationAlgo.cc.

References createfilelist::int, and hcalRecHitTable_cff::time.

Referenced by convert().

1651  {
1652  const float timeUnit = 0.01; // discretization (ns)
1653 
1654  if (time > 300.0)
1655  return 30000;
1656  if (time < -300.0)
1657  return -30000;
1658 
1659  return int(time / timeUnit + 0.5);
1660 }

◆ convert()

void CaloTowersCreationAlgo::convert ( const CaloTowerDetId id,
const MetaTower mt,
CaloTowerCollection collection 
)
private

if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*sumPf, emPoint.eta(), emPoint.phi(), 0);

Definition at line 928 of file CaloTowersCreationAlgo.cc.

References cms::cuda::assert(), PV3DBase< T, PVType, FrameType >::basicVector(), universalConfigTemplate::collection, compactTime(), edm::contains(), CaloTowerTopology::denseIndex(), change_name::diff, DetId::Ecal, ecalBadChs, digitizers_cfi::ecalTime, emShwrLogWeightPos(), emShwrPos(), PV3DBase< T, PVType, FrameType >::eta(), CaloTowerTopology::firstHFRing(), CaloSubdetectorGeometry::getGeometry(), hadShwrPos(), DetId::Hcal, hcalDropChMap, HcalOuter, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::ietaAbs(), ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), CaloTowerTopology::lastHBRing(), CaloTowerTopology::lastHERing(), CaloTowerTopology::lastHFRing(), CaloTowerTopology::lastHORing(), match(), missingHcalRescaleFactorForEcal, eostools::move(), TtSemiLepEvtBuilder_cfi::mt, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::phi(), nano_mu_digi_cff::rawId, edm::second(), mathSSE::sqrt(), HcalDetId::subdet(), theEBSumThreshold, theEcutTower, theEESumThreshold, theHcalThreshold, theHOIsUsed, theMomConstrMethod, theMomEBDepth, theMomEEDepth, theMomHBDepth, theMomHEDepth, theTowerGeometry, theTowerTopology, Basic3DVector< T >::unit(), UNLIKELY, heppy_batch::val, and trackerHitRTTI::vector.

Referenced by finish().

928  {
929  assert(id.rawId() != 0);
930 
931  double ecalThres = (id.ietaAbs() <= 17) ? (theEBSumThreshold) : (theEESumThreshold);
932  double E = mt.E;
933  double E_em = mt.E_em;
934  double E_had = mt.E_had;
935  double E_outer = mt.E_outer;
936 
937  // Note: E_outer is used to save HO energy OR energy in the outermost depths in endcap region
938  // In the methods with separate treatment of EM and HAD components:
939  // - HO is not used to determine direction, however HO energy is added to get "total had energy"
940  // => Check if the tower is within HO coverage before adding E_outer to the "total had" energy
941  // else the energy will be double counted
942  // When summing up the energy of the tower these checks are performed in the loops over RecHits
943 
944  std::vector<std::pair<DetId, float> > metaContains = mt.metaConstituents;
945  if (id.ietaAbs() < theTowerTopology->firstHFRing() && E_em < ecalThres) { // ignore EM threshold in HF
946  E -= E_em;
947  E_em = 0;
948  std::vector<std::pair<DetId, float> > metaContains_noecal;
949 
950  for (std::vector<std::pair<DetId, float> >::iterator i = metaContains.begin(); i != metaContains.end(); ++i)
951  if (i->first.det() != DetId::Ecal)
952  metaContains_noecal.push_back(*i);
953  metaContains.swap(metaContains_noecal);
954  }
955  if (id.ietaAbs() < theTowerTopology->firstHFRing() && E_had < theHcalThreshold) {
956  E -= E_had;
957 
959  E -= E_outer; // not subtracted before, think it should be done
960 
961  E_had = 0;
962  E_outer = 0;
963  std::vector<std::pair<DetId, float> > metaContains_nohcal;
964 
965  for (std::vector<std::pair<DetId, float> >::iterator i = metaContains.begin(); i != metaContains.end(); ++i)
966  if (i->first.det() != DetId::Hcal)
967  metaContains_nohcal.push_back(*i);
968  metaContains.swap(metaContains_nohcal);
969  }
970 
971  if (metaContains.empty())
972  return;
973 
974  if (missingHcalRescaleFactorForEcal > 0 && E_had == 0 && E_em > 0) {
975  auto match = hcalDropChMap.find(id);
976  if (match != hcalDropChMap.end() && match->second.second) {
977  E_had = missingHcalRescaleFactorForEcal * E_em;
978  E += E_had;
979  }
980  }
981 
982  double E_had_tot = (theHOIsUsed && id.ietaAbs() <= theTowerTopology->lastHORing()) ? E_had + E_outer : E_had;
983 
984  // create CaloTower using the selected algorithm
985 
986  GlobalPoint emPoint, hadPoint;
987 
988  // this is actually a 4D vector
989  Basic3DVectorF towerP4;
990  bool massless = true;
991  // float mass1=0;
992  float mass2 = 0;
993 
994  // conditional assignment of depths for barrel/endcap
995  // Some additional tuning may be required in the transitional region
996  // 14<|iEta|<19
997  double momEmDepth = 0.;
998  double momHadDepth = 0.;
999  if (id.ietaAbs() <= 17) {
1000  momHadDepth = theMomHBDepth;
1001  momEmDepth = theMomEBDepth;
1002  } else {
1003  momHadDepth = theMomHEDepth;
1004  momEmDepth = theMomEEDepth;
1005  }
1006 
1007  switch (theMomConstrMethod) {
1008  // FIXME : move to simple cartesian algebra
1009  case 0: { // Simple 4-momentum assignment
1010  GlobalPoint p = theTowerGeometry->getGeometry(id)->getPosition();
1011  towerP4 = p.basicVector().unit();
1012  towerP4[3] = 1.f; // energy
1013  towerP4 *= E;
1014 
1015  // double pf=1.0/cosh(p.eta());
1016  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0);
1017 
1018  emPoint = p;
1019  hadPoint = p;
1020  } // end case 0
1021  break;
1022 
1023  case 1: { // separate 4-vectors for ECAL, HCAL, add to get the 4-vector of the tower (=>tower has mass!)
1024  if (id.ietaAbs() < theTowerTopology->firstHFRing()) {
1025  Basic3DVectorF emP4;
1026  if (E_em > 0) {
1027  emPoint = emShwrPos(metaContains, momEmDepth, E_em);
1028  emP4 = emPoint.basicVector().unit();
1029  emP4[3] = 1.f; // energy
1030  towerP4 = emP4 * E_em;
1031 
1032  // double emPf = 1.0/cosh(emPoint.eta());
1033  // towerP4 += CaloTower::PolarLorentzVector(E_em*emPf, emPoint.eta(), emPoint.phi(), 0);
1034  }
1035  if ((E_had + E_outer) > 0) {
1036  massless = (E_em <= 0);
1037  hadPoint = hadShwrPos(id, momHadDepth);
1038  auto lP4 = hadPoint.basicVector().unit();
1039  lP4[3] = 1.f; // energy
1040  if (!massless) {
1041  auto diff = lP4 - emP4;
1042  mass2 = std::sqrt(E_em * E_had_tot * diff.mag2());
1043  }
1044  lP4 *= E_had_tot;
1045  towerP4 += lP4;
1046  /*
1047  if (!massless) {
1048  auto p = towerP4;
1049  double m2 = double(p[3]*p[3]) - double(p[0]*p[0])+double(p[1]*p[1])+double(p[2]*p[2]); mass1 = m2>0 ? std::sqrt(m2) : 0;
1050  }
1051  */
1052  // double hadPf = 1.0/cosh(hadPoint.eta());
1053  // if (E_had_tot>0) {
1054  // towerP4 += CaloTower::PolarLorentzVector(E_had_tot*hadPf, hadPoint.eta(), hadPoint.phi(), 0);
1055  // }
1056  }
1057  } else { // forward detector: use the CaloTower position
1058  GlobalPoint p = theTowerGeometry->getGeometry(id)->getPosition();
1059  towerP4 = p.basicVector().unit();
1060  towerP4[3] = 1.f; // energy
1061  towerP4 *= E;
1062  // double pf=1.0/cosh(p.eta());
1063  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
1064  emPoint = p;
1065  hadPoint = p;
1066  }
1067  } // end case 1
1068  break;
1069 
1070  case 2: { // use ECAL position for the tower (when E_cal>0), else default CaloTower position (massless tower)
1071  if (id.ietaAbs() < theTowerTopology->firstHFRing()) {
1072  if (E_em > 0)
1073  emPoint = emShwrLogWeightPos(metaContains, momEmDepth, E_em);
1074  else
1075  emPoint = theTowerGeometry->getGeometry(id)->getPosition();
1076  towerP4 = emPoint.basicVector().unit();
1077  towerP4[3] = 1.f; // energy
1078  towerP4 *= E;
1079 
1080  // double sumPf = 1.0/cosh(emPoint.eta());
1082 
1083  hadPoint = emPoint;
1084  } else { // forward detector: use the CaloTower position
1085  GlobalPoint p = theTowerGeometry->getGeometry(id)->getPosition();
1086  towerP4 = p.basicVector().unit();
1087  towerP4[3] = 1.f; // energy
1088  towerP4 *= E;
1089 
1090  // double pf=1.0/cosh(p.eta());
1091  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
1092  emPoint = p;
1093  hadPoint = p;
1094  }
1095  } // end case 2
1096  break;
1097 
1098  } // end of decision on p4 reconstruction method
1099 
1100  // insert in collection (remove and return if below threshold)
1101  if UNLIKELY ((towerP4[3] == 0) & (E_outer > 0)) {
1102  float val = theHOIsUsed ? 0 : 1E-9; // to keep backwards compatibility for theHOIsUsed == true
1103  collection.emplace_back(id,
1104  E_em,
1105  E_had,
1106  E_outer,
1107  -1,
1108  -1,
1109  CaloTower::PolarLorentzVector(val, hadPoint.eta(), hadPoint.phi(), 0),
1110  emPoint,
1111  hadPoint);
1112  } else {
1113  collection.emplace_back(
1114  id, E_em, E_had, E_outer, -1, -1, GlobalVector(towerP4), towerP4[3], mass2, emPoint, hadPoint);
1115  }
1116  auto& caloTower = collection.back();
1117 
1118  // if (!massless) std::cout << "massive " << id <<' ' << mass1 <<' ' << mass2 <<' ' << caloTower.mass() << std::endl;
1119  // std::cout << "CaloTowerVI " <<theMomConstrMethod <<' ' << id <<' '<< E_em <<' '<< E_had <<' '<< E_outer <<' '<< GlobalVector(towerP4) <<' '<< towerP4[3] <<' '<< emPoint <<' '<< hadPoint << std::endl;
1120  //if (towerP4[3]==0) std::cout << "CaloTowerVIzero " << theEcutTower << ' ' << collection.back().eta() <<' '<< collection.back().phi() << std::endl;
1121 
1122  if (caloTower.energy() < theEcutTower) {
1123  collection.pop_back();
1124  return;
1125  }
1126 
1127  // set the timings
1128  float ecalTime = (mt.emSumEForTime > 0) ? mt.emSumTimeTimesE / mt.emSumEForTime : -9999;
1129  float hcalTime = (mt.hadSumEForTime > 0) ? mt.hadSumTimeTimesE / mt.hadSumEForTime : -9999;
1130  caloTower.setEcalTime(compactTime(ecalTime));
1131  caloTower.setHcalTime(compactTime(hcalTime));
1132  //add topology info
1133  caloTower.setHcalSubdet(theTowerTopology->lastHBRing(),
1137 
1138  // set the CaloTower status word =====================================
1139  // Channels must be counter exclusively in the defined cathegories
1140  // "Bad" channels (not used in energy assignment) can be flagged during
1141  // CaloTower creation only if specified in the configuration file
1142 
1143  unsigned int numBadHcalChan = mt.numBadHcalCells;
1144  // unsigned int numBadEcalChan = mt.numBadEcalCells;
1145  unsigned int numBadEcalChan = 0; //
1146 
1147  unsigned int numRecHcalChan = mt.numRecHcalCells;
1148  unsigned int numRecEcalChan = mt.numRecEcalCells;
1149  unsigned int numProbHcalChan = mt.numProbHcalCells;
1150  unsigned int numProbEcalChan = mt.numProbEcalCells;
1151 
1152  // now add dead/off/... channels not used in RecHit reconstruction for HCAL
1153  HcalDropChMap::iterator dropChItr = hcalDropChMap.find(id);
1154  if (dropChItr != hcalDropChMap.end())
1155  numBadHcalChan += dropChItr->second.first;
1156 
1157  // for ECAL the number of all bad channels is obtained here -----------------------
1158 
1159  /*
1160  // old hyper slow algorithm
1161  // get all possible constituents of the tower
1162  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
1163 
1164  for (std::vector<DetId>::iterator ac_it=allConstituents.begin();
1165  ac_it!=allConstituents.end(); ++ac_it) {
1166 
1167  if (ac_it->det()!=DetId::Ecal) continue;
1168 
1169  int thisEcalSevLvl = -999;
1170 
1171  if (ac_it->subdetId() == EcalBarrel && theEbHandle.isValid()) {
1172  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEbHandle);//, *theEcalChStatus);
1173  }
1174  else if (ac_it->subdetId() == EcalEndcap && theEeHandle.isValid()) {
1175  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEeHandle);//, *theEcalChStatus);
1176  }
1177 
1178  // check if the Ecal severity is ok to keep
1179  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1180  theEcalSeveritiesToBeExcluded.end(),
1181  thisEcalSevLvl);
1182  if (sevit!=theEcalSeveritiesToBeExcluded.end()) {
1183  ++numBadEcalChan;
1184  }
1185 
1186  }
1187 
1188  // compare with fast version
1189 
1190  // hcal:
1191  int inEcals[2] = {0,0};
1192  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i) {
1193  DetId detId = i->first;
1194  if(detId.det() == DetId::Ecal){
1195  if( detId.subdetId()==EcalBarrel ) inEcals[0] =1;
1196  else if( detId.subdetId()==EcalEndcap ) inEcals[1] =1;
1197  }
1198  }
1199 
1200  auto numBadEcalChanNew = ecalBadChs[theTowerTopology->denseIndex(id)]+mt.numBadEcalCells; // - mt.numRecEcalCells
1201  if (int(numBadEcalChanNew)!=int(numBadEcalChan)) {
1202  std::cout << "VI wrong " << ((inEcals[1]==1) ? "EE" : "" ) << id << " " << numBadEcalChanNew << " " << numBadEcalChan
1203  << " " << mt.numBadEcalCells << " " << mt.numRecEcalCells << std::endl;
1204  }
1205  */
1206 
1207  numBadEcalChan = ecalBadChs[theTowerTopology->denseIndex(id)] + mt.numBadEcalCells; // - mt.numRecEcalCells
1208 
1209  //--------------------------------------------------------------------------------------
1210 
1211  caloTower.setCaloTowerStatus(
1212  numBadHcalChan, numBadEcalChan, numRecHcalChan, numRecEcalChan, numProbHcalChan, numProbEcalChan);
1213 
1214  double maxCellE = -999.0; // for storing the hottest cell E in the calotower
1215 
1216  std::vector<DetId> contains;
1217  contains.reserve(metaContains.size());
1218  for (std::vector<std::pair<DetId, float> >::iterator i = metaContains.begin(); i != metaContains.end(); ++i) {
1219  contains.push_back(i->first);
1220 
1221  if (maxCellE < i->second) {
1222  // need an extra check because of the funny towers that are empty except for the presence of an HO
1223  // hit in the constituents (JetMET wanted them saved)
1224  // This constituent is only used for storing the tower, but should not be concidered as a hot cell canditate for
1225  // configurations with useHO = false
1226 
1227  if (i->first.det() == DetId::Ecal) { // ECAL
1228  maxCellE = i->second;
1229  } else { // HCAL
1230  if (HcalDetId(i->first).subdet() != HcalOuter)
1231  maxCellE = i->second;
1232  else if (theHOIsUsed)
1233  maxCellE = i->second;
1234  }
1235 
1236  } // found higher E cell
1237 
1238  } // loop over matacontains
1239 
1240  caloTower.setConstituents(std::move(contains));
1241  caloTower.setHottestCellE(maxCellE);
1242 
1243  // std::cout << "CaloTowerVI " << nalgo << ' ' << caloTower.id() << ((inEcals[1]==1) ? "EE " : " " ) << caloTower.pt() << ' ' << caloTower.et() << ' ' << caloTower.mass() << ' '
1244  // << caloTower.constituentsSize() <<' '<< caloTower.towerStatusWord() << std::endl;
1245 }
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
int lastHFRing() const
assert(be >=bs)
int lastHERing() const
int lastHORing() const
U second(std::pair< T, U > const &p)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ietaAbs(uint32_t id)
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
const CaloSubdetectorGeometry * theTowerGeometry
T sqrt(T t)
Definition: SSEVec.h:19
const CaloTowerTopology * theTowerTopology
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
GlobalPoint hadShwrPos(const std::vector< std::pair< DetId, float >> &metaContains, float fracDepth, double hadE)
std::vector< unsigned short > ecalBadChs
GlobalPoint emShwrPos(const std::vector< std::pair< DetId, float >> &metaContains, float fracDepth, double totEmE)
int firstHFRing() const
uint32_t denseIndex(const DetId &id) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
Basic3DVector unit() const
#define UNLIKELY(x)
Definition: Likely.h:21
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
def move(src, dest)
Definition: eostools.py:511
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalPoint emShwrLogWeightPos(const std::vector< std::pair< DetId, float >> &metaContains, float fracDepth, double totEmE)
int lastHBRing() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38

◆ ecalChanStatusForCaloTower()

std::tuple< unsigned int, bool > CaloTowersCreationAlgo::ecalChanStatusForCaloTower ( const EcalRecHit hit)

Definition at line 1821 of file CaloTowersCreationAlgo.cc.

References BadChan, runTheMatrix::const, spr::find(), GoodChan, IgnoredChan, EcalSeverityLevel::kBad, EcalSeverityLevel::kGood, EcalSeverityLevel::kRecovered, ProblematicChan, RecoveredChan, interestingDetIdCollectionProducer_cfi::severityLevel, EcalSeverityLevelAlgo::severityLevel(), theEcalSeveritiesToBeExcluded, theEcalSeveritiesToBeUsedInBadTowers, theEcalSevLvlAlgo, theRecoveredEcalHitsAreUsed, useRejectedHitsOnly, and useRejectedRecoveredEcalHits.

Referenced by assignHitEcal().

1821  {
1822  // const DetId id = hit->detid();
1823 
1824  // uint16_t dbStatus = theEcalChStatus->find(id)->getStatusCode();
1825  // uint32_t rhFlags = hit->flags();
1826  // int severityLevel = theEcalSevLvlAlgo->severityLevel(rhFlags, dbStatus);
1827  // The methods above will become private and cannot be usef for flagging ecal spikes.
1828  // Use the recommended interface - we leave the parameters for spilke removal to be specified by ECAL.
1829 
1830  // int severityLevel = 999;
1831 
1832  EcalRecHit const& rh = *reinterpret_cast<EcalRecHit const*>(hit);
1834 
1835  // if (id.subdetId() == EcalBarrel) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEbHandle);//, *theEcalChStatus);
1836  // else if (id.subdetId() == EcalEndcap) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEeHandle);//, *theEcalChStatus);
1837 
1838  // there should be no other ECAL types used in this reconstruction
1839 
1840  // The definition of ECAL severity levels uses categories that
1841  // are similar to the defined for CaloTower. (However, the categorization
1842  // for CaloTowers depends on the specified maximum acceptabel severity and therefore cannnot
1843  // be exact correspondence between the two. ECAL has additional categories describing modes of failure.)
1844  // This approach is different from the initial idea and from
1845  // the implementation for HCAL. Still make the logic similar to HCAL so that one has the ability to
1846  // exclude problematic channels as defined by ECAL.
1847  // For definitions of ECAL severity levels see RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h
1848 
1849  bool isBad = (severityLevel == EcalSeverityLevel::kBad);
1850 
1851  bool isRecovered = (severityLevel == EcalSeverityLevel::kRecovered);
1852 
1853  // check if the severity is compatible with our configuration
1854  // This applies to the "default" tower cleaning
1855  std::vector<int>::const_iterator sevit =
1857  bool accepted = (sevit == theEcalSeveritiesToBeExcluded.end());
1858 
1859  // For use with hits that were rejected in the regular reconstruction:
1860  // This is for creating calotowers with lower level of cleaning by merging
1861  // the information from the default towers and a collection of towers created from
1862  // bad rechits
1863 
1864  if (useRejectedHitsOnly) {
1865  if (!isRecovered) {
1866  if (accepted || std::find(theEcalSeveritiesToBeUsedInBadTowers.begin(),
1869  return std::make_tuple(CaloTowersCreationAlgo::IgnoredChan, isBad);
1870  // this hit was either already accepted, or is not eligible for inclusion
1871  } else {
1873  // skip recovered hits either because they were already used or because there was an explicit instruction
1874  return std::make_tuple(CaloTowersCreationAlgo::IgnoredChan, isBad);
1875  ;
1876  } else if (useRejectedRecoveredEcalHits) {
1877  return std::make_tuple(CaloTowersCreationAlgo::RecoveredChan, isBad);
1878  }
1879 
1880  } // recovered channels
1881 
1882  // clasify channels as problematic
1883  return std::make_tuple(CaloTowersCreationAlgo::ProblematicChan, isBad);
1884 
1885  } // treatment of rejected hits
1886 
1887  // for normal reconstruction
1889  return std::make_tuple(CaloTowersCreationAlgo::GoodChan, false);
1890 
1891  if (isRecovered) {
1892  return std::make_tuple(
1894  } else {
1895  return std::make_tuple(accepted ? CaloTowersCreationAlgo::ProblematicChan : CaloTowersCreationAlgo::BadChan, isBad);
1896  }
1897 }
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< int > theEcalSeveritiesToBeExcluded
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo

◆ emCrystalShwrPos()

GlobalPoint CaloTowersCreationAlgo::emCrystalShwrPos ( DetId  detId,
float  fracDepth 
)

Definition at line 1414 of file CaloTowersCreationAlgo.cc.

References hcalRecHitTable_cff::detId, CaloGeometry::getGeometry(), point, and theGeometry.

Referenced by emShwrLogWeightPos(), emShwrPos(), and hadSegmentShwrPos().

1414  {
1415  auto cellGeometry = theGeometry->getGeometry(detId);
1416  GlobalPoint point = cellGeometry->getPosition(); // face of the cell
1417 
1418  if (fracDepth <= 0)
1419  return point;
1420  if (fracDepth > 1)
1421  fracDepth = 1;
1422 
1423  const GlobalPoint& backPoint = cellGeometry->getBackPoint();
1424  point += fracDepth * (backPoint - point);
1425 
1426  return point;
1427 }
const CaloGeometry * theGeometry
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

◆ emShwrLogWeightPos()

GlobalPoint CaloTowersCreationAlgo::emShwrLogWeightPos ( const std::vector< std::pair< DetId, float >> &  metaContains,
float  fracDepth,
double  totEmE 
)

Definition at line 1614 of file CaloTowersCreationAlgo.cc.

References DetId::Ecal, emCrystalShwrPos(), dqm-mbProfile::log, AlCaHLTBitMon_ParallelJobs::p, and mps_merge::weight.

Referenced by convert().

1616  {
1617  double emX = 0.0;
1618  double emY = 0.0;
1619  double emZ = 0.0;
1620 
1621  double weight = 0;
1622  double sumWeights = 0;
1623  double sumEmE = 0; // add crystals with E/E_EM > 1.5%
1624  double crystalThresh = 0.015 * emE;
1625 
1626  std::vector<std::pair<DetId, float> >::const_iterator mc_it = metaContains.begin();
1627  for (; mc_it != metaContains.end(); ++mc_it) {
1628  if (mc_it->second < 0)
1629  continue;
1630  if (mc_it->first.det() == DetId::Ecal && mc_it->second > crystalThresh)
1631  sumEmE += mc_it->second;
1632  }
1633 
1634  for (mc_it = metaContains.begin(); mc_it != metaContains.end(); ++mc_it) {
1635  if (mc_it->first.det() != DetId::Ecal || mc_it->second < crystalThresh)
1636  continue;
1637 
1638  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1639 
1640  weight = 4.2 + log(mc_it->second / sumEmE);
1641  sumWeights += weight;
1642 
1643  emX += p.x() * weight;
1644  emY += p.y() * weight;
1645  emZ += p.z() * weight;
1646  }
1647 
1648  return GlobalPoint(emX / sumWeights, emY / sumWeights, emZ / sumWeights);
1649 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Definition: weight.py:1

◆ emShwrPos()

GlobalPoint CaloTowersCreationAlgo::emShwrPos ( const std::vector< std::pair< DetId, float >> &  metaContains,
float  fracDepth,
double  totEmE 
)

Definition at line 1584 of file CaloTowersCreationAlgo.cc.

References MillePedeFileConverter_cfg::e, DetId::Ecal, emCrystalShwrPos(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by convert().

1586  {
1587  if (emE <= 0)
1588  return GlobalPoint(0, 0, 0);
1589 
1590  double emX = 0.0;
1591  double emY = 0.0;
1592  double emZ = 0.0;
1593 
1594  double eSum = 0;
1595 
1596  std::vector<std::pair<DetId, float> >::const_iterator mc_it = metaContains.begin();
1597  for (; mc_it != metaContains.end(); ++mc_it) {
1598  if (mc_it->first.det() != DetId::Ecal)
1599  continue;
1600  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1601  double e = mc_it->second;
1602 
1603  if (e > 0) {
1604  emX += p.x() * e;
1605  emY += p.y() * e;
1606  emZ += p.z() * e;
1607  eSum += e;
1608  }
1609  }
1610 
1611  return GlobalPoint(emX / eSum, emY / eSum, emZ / eSum);
1612 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10

◆ find()

CaloTowersCreationAlgo::MetaTower & CaloTowersCreationAlgo::find ( const CaloTowerDetId id)
private

looks for a given tower in the internal cache. If it can't find it, it makes it.

Definition at line 912 of file CaloTowersCreationAlgo.cc.

References CaloTowerTopology::denseIndex(), hcalRecHitTable_cff::detId, CaloTowerTopology::firstHFRing(), TtSemiLepEvtBuilder_cfi::mt, CaloTowerTopology::sizeForDenseIndexing(), theTowerMap, theTowerMapSize, and theTowerTopology.

Referenced by assignHitEcal(), assignHitHcal(), and rescale().

912  {
913  if (theTowerMap.empty()) {
915  }
916 
918 
919  if (mt.empty()) {
920  mt.id = detId;
921  mt.metaConstituents.reserve(detId.ietaAbs() < theTowerTopology->firstHFRing() ? 12 : 2);
922  ++theTowerMapSize;
923  }
924 
925  return mt;
926 }
uint32_t sizeForDenseIndexing() const
const CaloTowerTopology * theTowerTopology
int firstHFRing() const
uint32_t denseIndex(const DetId &id) const

◆ finish()

void CaloTowersCreationAlgo::finish ( CaloTowerCollection destCollection)

Definition at line 408 of file CaloTowersCreationAlgo.cc.

References convert(), TtSemiLepEvtBuilder_cfi::mt, mps_fire::result, theTowerMap, and theTowerMapSize.

Referenced by progressbar.ProgressBar::__next__(), and CaloTowersCreator::produce().

408  {
409  // now copy this map into the final collection
410  result.reserve(theTowerMapSize);
411  // auto k=0U;
412  // if (!theEbHandle.isValid()) std::cout << "VI ebHandle not valid" << std::endl;
413  // if (!theEeHandle.isValid()) std::cout << "VI eeHandle not valid" << std::endl;
414 
415  for (auto const& mt : theTowerMap) {
416  // Convert only if there is at least one constituent in the metatower.
417  // The check of constituents size in the coverted tower is still needed!
418  if (!mt.empty()) {
419  convert(mt.id, mt, result);
420  } // ++k;}
421  }
422 
423  // assert(k==theTowerMapSize);
424  // std::cout << "VI TowerMap " << theTowerMapSize << " " << k << std::endl;
425 
426  theTowerMap.clear(); // save the memory
427  theTowerMapSize = 0;
428 }
void convert(const CaloTowerDetId &id, const MetaTower &mt, CaloTowerCollection &collection)

◆ getThresholdAndWeight()

void CaloTowersCreationAlgo::getThresholdAndWeight ( const DetId detId,
double &  threshold,
double &  weight 
) const
private

helper method to look up the appropriate threshold & weight

Definition at line 1247 of file CaloTowersCreationAlgo.cc.

References hcalRecHitTable_cff::depth, HcalDetId::depth(), hcalRecHitTable_cff::detId, DetId::Ecal, EcalBarrel, EcalEndcap, HcalTopology::firstHEDoublePhiRing(), HcalCondObjectContainer< Item >::getValues(), DetId::Hcal, HcalBarrel, hcalCuts, HcalEndcap, HcalForward, HcalOuter, HcalDetId::ieta(), HcalDetId::ietaAbs(), fftjetcommon_cfi::Interpolator, B2GTnPMonitor_cfi::item, DetId::rawId(), HcalDetId::subdet(), theEBEScale, theEBGrid, theEBthreshold, theEBweight, theEBWeights, theEEEScale, theEEGrid, theEEthreshold, theEEweight, theEEWeights, theHBEScale, theHBGrid, theHBthreshold, theHBthreshold1, theHBthreshold2, theHBweight, theHBWeights, theHcalTopology, theHEDEScale, theHEDGrid, theHEDthreshold, theHEDthreshold1, theHEDweight, theHEDWeights, theHESEScale, theHESGrid, theHESthreshold, theHESthreshold1, theHESweight, theHESWeights, theHF1EScale, theHF1Grid, theHF1threshold, theHF1weight, theHF1Weights, theHF2EScale, theHF2Grid, theHF2threshold, theHF2weight, theHF2Weights, theHOEScale, theHOGrid, theHOthreshold0, theHOthresholdMinus1, theHOthresholdMinus2, theHOthresholdPlus1, theHOthresholdPlus2, theHOweight, theHOWeights, and DiMuonV_cfg::threshold.

Referenced by assignHitEcal(), assignHitHcal(), rescale(), and rescaleTowers().

1247  {
1248  DetId::Detector det = detId.det();
1249  weight = 0; // in case the hit is not identified
1250 
1251  if (det == DetId::Ecal) {
1252  // may or may not be EB. We'll find out.
1253 
1254  EcalSubdetector subdet = (EcalSubdetector)(detId.subdetId());
1255  if (subdet == EcalBarrel) {
1257  weight = theEBweight;
1258  if (weight <= 0.) {
1259  ROOT::Math::Interpolator my(theEBGrid, theEBWeights, ROOT::Math::Interpolation::kAKIMA);
1260  weight = my.Eval(theEBEScale);
1261  }
1262  } else if (subdet == EcalEndcap) {
1264  weight = theEEweight;
1265  if (weight <= 0.) {
1266  ROOT::Math::Interpolator my(theEEGrid, theEEWeights, ROOT::Math::Interpolation::kAKIMA);
1267  weight = my.Eval(theEEEScale);
1268  }
1269  }
1270  } else if (det == DetId::Hcal) {
1271  HcalDetId hcalDetId(detId);
1272  HcalSubdetector subdet = hcalDetId.subdet();
1273  int depth = hcalDetId.depth();
1274 
1275  if (subdet == HcalBarrel) {
1276  if (hcalCuts == nullptr) { // this means cutsFromDB is false
1278  } else { // hcalCuts is not nullptr, i.e. cutsFromDB is true
1279  const HcalPFCut* item = hcalCuts->getValues(hcalDetId.rawId());
1280  threshold = item->noiseThreshold();
1281  }
1282  weight = theHBweight;
1283  if (weight <= 0.) {
1284  ROOT::Math::Interpolator my(theHBGrid, theHBWeights, ROOT::Math::Interpolation::kAKIMA);
1285  weight = my.Eval(theHBEScale);
1286  }
1287  }
1288 
1289  else if (subdet == HcalEndcap) {
1290  // check if it's single or double tower
1291  if (hcalDetId.ietaAbs() < theHcalTopology->firstHEDoublePhiRing()) {
1292  if (hcalCuts == nullptr) { // this means cutsFromDB is false
1294  } else { // hcalCuts is not nullptr, i.e. cutsFromDB is true
1295  const HcalPFCut* item = hcalCuts->getValues(hcalDetId.rawId());
1296  threshold = item->noiseThreshold();
1297  }
1298  weight = theHESweight;
1299  if (weight <= 0.) {
1300  ROOT::Math::Interpolator my(theHESGrid, theHESWeights, ROOT::Math::Interpolation::kAKIMA);
1301  weight = my.Eval(theHESEScale);
1302  }
1303  } else {
1304  if (hcalCuts == nullptr) { // this means cutsFromDB is false
1306  } else { // hcalCuts is not nullptr, i.e. cutsFromDB is true
1307  const HcalPFCut* item = hcalCuts->getValues(hcalDetId.rawId());
1308  threshold = item->noiseThreshold();
1309  }
1310  weight = theHEDweight;
1311  if (weight <= 0.) {
1312  ROOT::Math::Interpolator my(theHEDGrid, theHEDWeights, ROOT::Math::Interpolation::kAKIMA);
1313  weight = my.Eval(theHEDEScale);
1314  }
1315  }
1316  }
1317 
1318  else if (subdet == HcalOuter) {
1319  //check if it's ring 0 or +1 or +2 or -1 or -2
1320  if (hcalDetId.ietaAbs() <= 4)
1322  else if (hcalDetId.ieta() < 0) {
1323  // set threshold for ring -1 or -2
1324  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdMinus1 : theHOthresholdMinus2;
1325  } else {
1326  // set threshold for ring +1 or +2
1327  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdPlus1 : theHOthresholdPlus2;
1328  }
1329  weight = theHOweight;
1330  if (weight <= 0.) {
1331  ROOT::Math::Interpolator my(theHOGrid, theHOWeights, ROOT::Math::Interpolation::kAKIMA);
1332  weight = my.Eval(theHOEScale);
1333  }
1334  }
1335 
1336  else if (subdet == HcalForward) {
1337  if (hcalDetId.depth() == 1) {
1339  weight = theHF1weight;
1340  if (weight <= 0.) {
1341  ROOT::Math::Interpolator my(theHF1Grid, theHF1Weights, ROOT::Math::Interpolation::kAKIMA);
1342  weight = my.Eval(theHF1EScale);
1343  }
1344  } else {
1346  weight = theHF2weight;
1347  if (weight <= 0.) {
1348  ROOT::Math::Interpolator my(theHF2Grid, theHF2Weights, ROOT::Math::Interpolation::kAKIMA);
1349  weight = my.Eval(theHF2EScale);
1350  }
1351  }
1352  }
1353  } else {
1354  edm::LogError("CaloTowersCreationAlgo") << "Bad cell: " << det << std::endl;
1355  }
1356 }
std::vector< double > theHBGrid
std::vector< double > theHESGrid
std::vector< double > theHEDGrid
Definition: weight.py:1
std::vector< double > theHOWeights
Log< level::Error, false > LogError
std::vector< double > theEEGrid
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< double > theEEWeights
std::vector< double > theHESWeights
std::vector< double > theHF2Grid
std::vector< double > theHEDWeights
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< double > theHOGrid
std::vector< double > theHF1Weights
std::vector< double > theHBWeights
Detector
Definition: DetId.h:24
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:101
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
EcalSubdetector
std::vector< double > theEBWeights

◆ hadSegmentShwrPos()

GlobalPoint CaloTowersCreationAlgo::hadSegmentShwrPos ( DetId  detId,
float  fracDepth 
)

Definition at line 1429 of file CaloTowersCreationAlgo.cc.

References hcalRecHitTable_cff::detId, and emCrystalShwrPos().

1429  {
1430  // same code as above
1431  return emCrystalShwrPos(detId, fracDepth);
1432 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)

◆ hadShwPosFromCells()

GlobalPoint CaloTowersCreationAlgo::hadShwPosFromCells ( DetId  frontCell,
DetId  backCell,
float  fracDepth 
)

Definition at line 1557 of file CaloTowersCreationAlgo.cc.

References gather_cfg::cout, CaloGeometry::getGeometry(), HcalTopology::getMergePositionFlag(), HcalTopology::idBack(), HcalTopology::idFront(), point, theGeometry, and theHcalTopology.

Referenced by hadShwrPos().

1557  {
1558  // uses the "front" and "back" cells
1559  // to determine the axis. point set by the predefined depth.
1560 
1561  HcalDetId hid1(frontCellId), hid2(backCellId);
1563  hid1 = theHcalTopology->idFront(frontCellId);
1564 #ifdef EDM_ML_DEBUG
1565  std::cout << "Front " << HcalDetId(frontCellId) << " " << hid1 << "\n";
1566 #endif
1567  hid2 = theHcalTopology->idBack(backCellId);
1568 #ifdef EDM_ML_DEBUG
1569  std::cout << "Back " << HcalDetId(backCellId) << " " << hid2 << "\n";
1570 #endif
1571  }
1572 
1573  auto frontCellGeometry = theGeometry->getGeometry(DetId(hid1));
1574  auto backCellGeometry = theGeometry->getGeometry(DetId(hid2));
1575 
1576  GlobalPoint point = frontCellGeometry->getPosition();
1577  const GlobalPoint& backPoint = backCellGeometry->getBackPoint();
1578 
1579  point += fracDepth * (backPoint - point);
1580 
1581  return point;
1582 }
bool getMergePositionFlag() const
Definition: HcalTopology.h:167
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
const CaloGeometry * theGeometry
HcalDetId idBack(const HcalDetId &id) const
Definition: HcalTopology.h:171
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
Definition: DetId.h:17
const HcalTopology * theHcalTopology
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5

◆ hadShwrPos() [1/2]

GlobalPoint CaloTowersCreationAlgo::hadShwrPos ( const std::vector< std::pair< DetId, float >> &  metaContains,
float  fracDepth,
double  hadE 
)

Referenced by convert().

◆ hadShwrPos() [2/2]

GlobalPoint CaloTowersCreationAlgo::hadShwrPos ( CaloTowerDetId  id,
float  fracDepth 
)

Definition at line 1473 of file CaloTowersCreationAlgo.cc.

References funct::abs(), CaloTowerConstituentsMap::constituentsOf(), CaloTowerTopology::convertCTtoHcal(), gather_cfg::cout, HcalDetId::depth(), CaloTowerTopology::firstHFRing(), hadShwPosFromCells(), DetId::Hcal, HcalForward, HcalOuter, mps_fire::i, HcalTopology::idBack(), HcalTopology::idFront(), l1tPhase2CaloJetEmulator_cfi::iEta, mps_monitormerge::items, dqmdumpme::k, CaloTowerTopology::lastHERing(), point, HcalDetId::subdet(), theHcalPhase, theHcalTopology, theTowerConstituentsMap, theTowerTopology, ecaldqm::towerId(), and HcalTopology::validHcal().

1473  {
1474  // set depth using geometry of cells that are associated with the
1475  // tower (regardless if they have non-zero energies)
1476 
1477  // if (hadE <= 0) return GlobalPoint(0, 0, 0);
1478 #ifdef EDM_ML_DEBUG
1479  std::cout << "hadShwrPos " << towerId << " frac " << fracDepth << std::endl;
1480 #endif
1481  if (fracDepth < 0)
1482  fracDepth = 0;
1483  else if (fracDepth > 1)
1484  fracDepth = 1;
1485 
1486  GlobalPoint point(0, 0, 0);
1487 
1488  int iEta = towerId.ieta();
1489  int iPhi = towerId.iphi();
1490 
1491  HcalDetId frontCellId, backCellId;
1492 
1493  if (towerId.ietaAbs() >= theTowerTopology->firstHFRing()) {
1494  // forward, take the geometry for long fibers
1495  frontCellId = HcalDetId(HcalForward, towerId.zside() * theTowerTopology->convertCTtoHcal(abs(iEta)), iPhi, 1);
1496  backCellId = HcalDetId(HcalForward, towerId.zside() * theTowerTopology->convertCTtoHcal(abs(iEta)), iPhi, 1);
1497  } else {
1498  //use constituents map
1499  std::vector<DetId> items = theTowerConstituentsMap->constituentsOf(towerId);
1500  int frontDepth = 1000;
1501  int backDepth = -1000;
1502  for (unsigned i = 0; i < items.size(); i++) {
1503  if (items[i].det() != DetId::Hcal)
1504  continue;
1505  HcalDetId hid(items[i]);
1506  if (hid.subdet() == HcalOuter)
1507  continue;
1508  if (!theHcalTopology->validHcal(hid, 2))
1509  continue;
1510 
1511  if (theHcalTopology->idFront(hid).depth() < frontDepth) {
1512  frontCellId = hid;
1513  frontDepth = theHcalTopology->idFront(hid).depth();
1514  }
1515  if (theHcalTopology->idBack(hid).depth() > backDepth) {
1516  backCellId = hid;
1517  backDepth = theHcalTopology->idBack(hid).depth();
1518  }
1519  }
1520 #ifdef EDM_ML_DEBUG
1521  std::cout << "Front " << frontCellId << " Back " << backCellId << " Depths " << frontDepth << ":" << backDepth
1522  << std::endl;
1523 #endif
1524  //fix for tower 28/29 - no tower 29 at highest depths
1525  if (towerId.ietaAbs() == theTowerTopology->lastHERing() && (theHcalPhase == 0 || theHcalPhase == 1)) {
1526  CaloTowerDetId towerId28(towerId.ieta() - towerId.zside(), towerId.iphi());
1527  std::vector<DetId> items28 = theTowerConstituentsMap->constituentsOf(towerId28);
1528 #ifdef EDM_ML_DEBUG
1529  std::cout << towerId28 << " with " << items28.size() << " constituents:";
1530  for (unsigned k = 0; k < items28.size(); ++k)
1531  if (items28[k].det() == DetId::Hcal)
1532  std::cout << " " << HcalDetId(items28[k]);
1533  std::cout << std::endl;
1534 #endif
1535  for (unsigned i = 0; i < items28.size(); i++) {
1536  if (items28[i].det() != DetId::Hcal)
1537  continue;
1538  HcalDetId hid(items28[i]);
1539  if (hid.subdet() == HcalOuter)
1540  continue;
1541 
1542  if (theHcalTopology->idBack(hid).depth() > backDepth) {
1543  backCellId = hid;
1544  backDepth = theHcalTopology->idBack(hid).depth();
1545  }
1546  }
1547  }
1548 #ifdef EDM_ML_DEBUG
1549  std::cout << "Back " << backDepth << " ID " << backCellId << std::endl;
1550 #endif
1551  }
1552  point = hadShwPosFromCells(DetId(frontCellId), DetId(backCellId), fracDepth);
1553 
1554  return point;
1555 }
int lastHERing() const
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
int convertCTtoHcal(int ct_ieta) const
HcalDetId idBack(const HcalDetId &id) const
Definition: HcalTopology.h:171
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CaloTowerConstituentsMap * theTowerConstituentsMap
const CaloTowerTopology * theTowerTopology
Definition: DetId.h:17
GlobalPoint hadShwPosFromCells(DetId frontCell, DetId backCell, float fracDepth)
const HcalTopology * theHcalTopology
bool validHcal(const HcalDetId &id) const
int firstHFRing() const
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ hcalChanStatusForCaloTower()

unsigned int CaloTowersCreationAlgo::hcalChanStatusForCaloTower ( const CaloRecHit hit)

Definition at line 1770 of file CaloTowersCreationAlgo.cc.

References BadChan, gather_cfg::cout, HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), GoodChan, HcalTopology::idFront(), IgnoredChan, ProblematicChan, RecoveredChan, HcalSeverityLevelComputer::recoveredRecHit(), interestingDetIdCollectionProducer_cfi::severityLevel, theHcalAcceptSeverityLevel, theHcalAcceptSeverityLevelForRejectedHit, theHcalChStatus, theHcalSevLvlComputer, theHcalTopology, theRecoveredHcalHitsAreUsed, useRejectedHitsOnly, and useRejectedRecoveredHcalHits.

Referenced by assignHitHcal().

1770  {
1771  HcalDetId hid(hit->detid());
1772  DetId id = theHcalTopology->idFront(hid);
1773 #ifdef EDM_ML_DEBUG
1774  std::cout << "ChanStatusForCaloTower for " << hid << " to " << HcalDetId(id) << std::endl;
1775 #endif
1776  const uint32_t recHitFlag = hit->flags();
1777  const uint32_t dbStatusFlag = theHcalChStatus->getValues(id)->getValue();
1778 
1779  int severityLevel = theHcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatusFlag);
1780  bool isRecovered = theHcalSevLvlComputer->recoveredRecHit(id, recHitFlag);
1781 
1782  // For use with hits rejected in the default reconstruction
1783  if (useRejectedHitsOnly) {
1784  if (!isRecovered) {
1788  // this hit was either already accepted or is worse than
1789  } else {
1791  // skip recovered hits either because they were already used or because there was an explicit instruction
1793  } else if (useRejectedRecoveredHcalHits) {
1795  }
1796 
1797  } // recovered channels
1798 
1799  // clasify channels as problematic: no good hits are supposed to be present in the
1800  // extra rechit collections
1802 
1803  } // treatment of rejected hits
1804 
1805  // this is for the regular reconstruction sequence
1806 
1807  if (severityLevel == 0)
1809 
1810  if (isRecovered) {
1812  } else {
1815  } else {
1817  }
1818  }
1819 }
const HcalChannelQuality * theHcalChStatus
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
const Item * getValues(DetId fId, bool throwOnFail=true) const
HcalDetId idFront(const HcalDetId &id) const
Definition: HcalTopology.h:170
uint32_t getValue() const
const HcalSeverityLevelComputer * theHcalSevLvlComputer
Definition: DetId.h:17
const HcalTopology * theHcalTopology
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
unsigned int theHcalAcceptSeverityLevelForRejectedHit

◆ makeEcalBadChs()

void CaloTowersCreationAlgo::makeEcalBadChs ( )

Definition at line 1727 of file CaloTowersCreationAlgo.cc.

References CaloTowerConstituentsMap::constituentsOf(), CaloTowerTopology::detIdFromDenseIndex(), DetId::Ecal, ecalBadChs, spr::find(), EcalSeverityLevelAlgo::severityLevel(), CaloTowerTopology::sizeForDenseIndexing(), theEcalSeveritiesToBeExcluded, theEcalSevLvlAlgo, theTowerConstituentsMap, theTowerTopology, and mitigatedMETSequence_cff::U.

Referenced by CaloTowersCreator::produce().

1727  {
1728  // std::cout << "VI making EcalBadChs ";
1729 
1730  // for ECAL the number of all bad channels is obtained here -----------------------
1731 
1732  for (auto ind = 0U; ind < theTowerTopology->sizeForDenseIndexing(); ++ind) {
1733  auto& numBadEcalChan = ecalBadChs[ind];
1734  numBadEcalChan = 0;
1735  auto id = theTowerTopology->detIdFromDenseIndex(ind);
1736 
1737  // this is utterly slow... (can be optmized if really needed)
1738 
1739  // get all possible constituents of the tower
1740  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
1741 
1742  for (std::vector<DetId>::iterator ac_it = allConstituents.begin(); ac_it != allConstituents.end(); ++ac_it) {
1743  if (ac_it->det() != DetId::Ecal)
1744  continue;
1745 
1746  auto thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel(*ac_it);
1747 
1748  // check if the Ecal severity is ok to keep
1749  std::vector<int>::const_iterator sevit =
1751  if (sevit != theEcalSeveritiesToBeExcluded.end()) {
1752  ++numBadEcalChan;
1753  }
1754  }
1755 
1756  // if (0!=numBadEcalChan) std::cout << id << ":" << numBadEcalChan << ", ";
1757  }
1758 
1759  /*
1760  int tot=0;
1761  for (auto ind=0U; ind<theTowerTopology->sizeForDenseIndexing(); ++ind) {
1762  if (ecalBadChs[ind]!=0) ++tot;
1763  }
1764  std::cout << " | " << tot << std::endl;
1765  */
1766 }
uint32_t sizeForDenseIndexing() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
const CaloTowerConstituentsMap * theTowerConstituentsMap
const CaloTowerTopology * theTowerTopology
std::vector< int > theEcalSeveritiesToBeExcluded
std::vector< unsigned short > ecalBadChs
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )

◆ makeHcalDropChMap()

void CaloTowersCreationAlgo::makeHcalDropChMap ( )

Definition at line 1666 of file CaloTowersCreationAlgo.cc.

References CaloTowerConstituentsMap::constituentsOf(), gather_cfg::cout, HcalSeverityLevelComputer::dropChannel(), HcalCondObjectContainer< Item >::getAllChannels(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), DetId::Hcal, HcalBarrel, hcalDropChMap, HcalEndcap, CaloTowerDetId::ieta(), HcalDetId::ietaAbs(), CaloTowerDetId::iphi(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, HcalTopology::lastHERing(), HcalTopology::mergedDepth29(), HcalTopology::mergedDepthDetId(), missingHcalRescaleFactorForEcal, HcalDetId::subdet(), theHcalChStatus, theHcalPhase, theHcalSevLvlComputer, theHcalTopology, theTowerConstituentsMap, CaloTowerConstituentsMap::towerOf(), and CaloTowerDetId::zside().

Referenced by CaloTowersCreator::produce().

1666  {
1667  // This method fills the map of number of dead channels for the calotower,
1668  // The key of the map is CaloTowerDetId.
1669  // By definition these channels are not going to be in the RecHit collections.
1670  hcalDropChMap.clear();
1671  std::vector<DetId> allChanInStatusCont = theHcalChStatus->getAllChannels();
1672 
1673 #ifdef EDM_ML_DEBUG
1674  std::cout << "DropChMap with " << allChanInStatusCont.size() << " channels" << std::endl;
1675 #endif
1676  for (std::vector<DetId>::iterator it = allChanInStatusCont.begin(); it != allChanInStatusCont.end(); ++it) {
1677  const uint32_t dbStatusFlag = theHcalChStatus->getValues(*it)->getValue();
1678  if (theHcalSevLvlComputer->dropChannel(dbStatusFlag)) {
1680 
1682 
1683  hcalDropChMap[twrId].first += 1;
1684 
1685  HcalDetId hid(*it);
1686 
1687  // special case for tower 29: if HCAL hit is in depth 3 add to twr 29 as well
1688  if (hid.subdet() == HcalEndcap && (theHcalPhase == 0 || theHcalPhase == 1) &&
1689  hid.ietaAbs() == theHcalTopology->lastHERing() - 1) {
1690  bool merge = theHcalTopology->mergedDepth29(hid);
1691  if (merge) {
1692  CaloTowerDetId twrId29(twrId.ieta() + twrId.zside(), twrId.iphi());
1693  hcalDropChMap[twrId29].first += 1;
1694  }
1695  }
1696  }
1697  }
1698  // now I know how many bad channels, but I also need to know if there's any good ones
1700  for (auto& pair : hcalDropChMap) {
1701  if (pair.second.first == 0)
1702  continue; // unexpected, but just in case
1703  int ngood = 0, nbad = 0;
1704  for (DetId id : theTowerConstituentsMap->constituentsOf(pair.first)) {
1705  if (id.det() != DetId::Hcal)
1706  continue;
1707  HcalDetId hid(id);
1708  if (hid.subdet() != HcalBarrel && hid.subdet() != HcalEndcap)
1709  continue;
1710  const uint32_t dbStatusFlag = theHcalChStatus->getValues(id)->getValue();
1711  if (dbStatusFlag == 0 || !theHcalSevLvlComputer->dropChannel(dbStatusFlag)) {
1712  ngood += 1;
1713  } else {
1714  nbad += 1; // recount, since pair.second.first may include HO
1715  }
1716  }
1717  if (nbad > 0 && nbad >= ngood) {
1718  //uncomment for debug (may be useful to tune the criteria above)
1719  //CaloTowerDetId id(pair.first);
1720  //std::cout << "CaloTower at ieta = " << id.ieta() << ", iphi " << id.iphi() << ": set Hcal as not efficient (ngood =" << ngood << ", nbad = " << nbad << ")" << std::endl;
1721  pair.second.second = true;
1722  }
1723  }
1724  }
1725 }
bool mergedDepth29(HcalDetId id) const
Definition: HcalTopology.h:111
Definition: merge.py:1
const HcalChannelQuality * theHcalChStatus
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< DetId > getAllChannels() const
const CaloTowerConstituentsMap * theTowerConstituentsMap
uint32_t getValue() const
const HcalSeverityLevelComputer * theHcalSevLvlComputer
Definition: DetId.h:17
int iphi() const
get the tower iphi
int ieta() const
get the tower ieta
const HcalTopology * theHcalTopology
HcalDetId mergedDepthDetId(const HcalDetId &id) const
Definition: HcalTopology.h:166
int zside() const
get the z-side of the tower (1/-1)
int lastHERing() const
Definition: HcalTopology.h:94
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
bool dropChannel(const uint32_t &mystatus) const

◆ process() [1/5]

void CaloTowersCreationAlgo::process ( const HBHERecHitCollection hbhe)

Definition at line 378 of file CaloTowersCreationAlgo.cc.

References assignHitHcal(), and photonIsolationHIProducer_cfi::hbhe.

Referenced by CaloTowersCreator::produce().

378  {
379  for (HBHERecHitCollection::const_iterator hbheItr = hbhe.begin(); hbheItr != hbhe.end(); ++hbheItr)
380  assignHitHcal(&(*hbheItr));
381 }
void assignHitHcal(const CaloRecHit *recHit)
std::vector< T >::const_iterator const_iterator

◆ process() [2/5]

void CaloTowersCreationAlgo::process ( const HORecHitCollection ho)

Definition at line 383 of file CaloTowersCreationAlgo.cc.

References assignHitHcal(), and photonIsolationHIProducer_cfi::ho.

383  {
384  for (HORecHitCollection::const_iterator hoItr = ho.begin(); hoItr != ho.end(); ++hoItr)
385  assignHitHcal(&(*hoItr));
386 }
void assignHitHcal(const CaloRecHit *recHit)
std::vector< T >::const_iterator const_iterator

◆ process() [3/5]

void CaloTowersCreationAlgo::process ( const HFRecHitCollection hf)

Definition at line 388 of file CaloTowersCreationAlgo.cc.

References assignHitHcal(), and photonIsolationHIProducer_cfi::hf.

388  {
389  for (HFRecHitCollection::const_iterator hfItr = hf.begin(); hfItr != hf.end(); ++hfItr)
390  assignHitHcal(&(*hfItr));
391 }
void assignHitHcal(const CaloRecHit *recHit)
std::vector< T >::const_iterator const_iterator

◆ process() [4/5]

void CaloTowersCreationAlgo::process ( const EcalRecHitCollection ecal)

Definition at line 393 of file CaloTowersCreationAlgo.cc.

References assignHitEcal(), edm::SortedCollection< T, SORT >::begin(), and edm::SortedCollection< T, SORT >::end().

393  {
394  for (EcalRecHitCollection::const_iterator ecItr = ec.begin(); ecItr != ec.end(); ++ecItr)
395  assignHitEcal(&(*ecItr));
396 }
std::vector< EcalRecHit >::const_iterator const_iterator
void assignHitEcal(const EcalRecHit *recHit)
adds a single hit to the tower

◆ process() [5/5]

void CaloTowersCreationAlgo::process ( const CaloTowerCollection ctc)

Definition at line 402 of file CaloTowersCreationAlgo.cc.

References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), and rescale().

402  {
403  for (CaloTowerCollection::const_iterator ctcItr = ctc.begin(); ctcItr != ctc.end(); ++ctcItr) {
404  rescale(&(*ctcItr));
405  }
406 }
std::vector< CaloTower >::const_iterator const_iterator
void rescale(const CaloTower *ct)
const_iterator begin() const
const_iterator end() const

◆ rescale()

void CaloTowersCreationAlgo::rescale ( const CaloTower ct)
private

Definition at line 868 of file CaloTowersCreationAlgo.cc.

References CaloTower::constituent(), CaloTower::constituentsSize(), HcalDetId::depth(), hcalRecHitTable_cff::detId, DetId::Ecal, CaloTower::ecalTime(), CaloTower::emEnergy(), find(), getThresholdAndWeight(), CaloTower::hadEnergy(), HcalForward, HcalOuter, CaloTower::hcalTime(), mps_fire::i, CaloTower::id(), CaloTowersParam_cfi::mc, DetId::null(), CaloTower::outerEnergy(), HcalDetId::subdet(), theTowerConstituentsMap, DiMuonV_cfg::threshold, l1tHGCalTowerProducer_cfi::tower, CaloTowerConstituentsMap::towerOf(), and mps_merge::weight.

Referenced by process().

868  {
869  double threshold, weight;
870  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(ct->id());
871  if (towerDetId.null())
872  return;
873  MetaTower& tower = find(towerDetId);
874 
875  tower.E_em = 0.;
876  tower.E_had = 0.;
877  tower.E_outer = 0.;
878  for (unsigned int i = 0; i < ct->constituentsSize(); i++) {
879  DetId detId = ct->constituent(i);
881  DetId::Detector det = detId.det();
882  if (det == DetId::Ecal) {
883  tower.E_em = ct->emEnergy() * weight;
884  } else {
885  HcalDetId hcalDetId(detId);
886  if (hcalDetId.subdet() == HcalForward) {
887  if (hcalDetId.depth() == 1)
888  tower.E_em = ct->emEnergy() * weight;
889  if (hcalDetId.depth() == 2)
890  tower.E_had = ct->hadEnergy() * weight;
891  } else if (hcalDetId.subdet() == HcalOuter) {
892  tower.E_outer = ct->outerEnergy() * weight;
893  } else {
894  tower.E_had = ct->hadEnergy() * weight;
895  }
896  }
897  tower.E = tower.E_had + tower.E_em + tower.E_outer;
898 
899  // this is to be compliant with the new MetaTower setup
900  // used only for the default simple vector assignment
901  std::pair<DetId, float> mc(detId, 0);
902  tower.metaConstituents.push_back(mc);
903  }
904 
905  // preserve time inforamtion
906  tower.emSumTimeTimesE = ct->ecalTime();
907  tower.hadSumTimeTimesE = ct->hcalTime();
908  tower.emSumEForTime = 1.0;
909  tower.hadSumEForTime = 1.0;
910 }
float hcalTime() const
Definition: CaloTower.h:197
double outerEnergy() const
Definition: CaloTower.h:132
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold & weight
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
Definition: weight.py:1
MetaTower & find(const CaloTowerDetId &id)
looks for a given tower in the internal cache. If it can&#39;t find it, it makes it.
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
const CaloTowerConstituentsMap * theTowerConstituentsMap
DetId constituent(size_t i) const
Definition: CaloTower.h:126
Definition: DetId.h:17
double emEnergy() const
Definition: CaloTower.h:130
Detector
Definition: DetId.h:24
size_t constituentsSize() const
Definition: CaloTower.h:125
double hadEnergy() const
Definition: CaloTower.h:131
float ecalTime() const
Definition: CaloTower.h:196
CaloTowerDetId id() const
Definition: CaloTower.h:123

◆ rescaleTowers()

void CaloTowersCreationAlgo::rescaleTowers ( const CaloTowerCollection ctInput,
CaloTowerCollection ctResult 
)

Definition at line 430 of file CaloTowersCreationAlgo.cc.

References CaloTower::addConstituents(), edm::SortedCollection< T, SORT >::begin(), edm::contains(), DetId::det(), DetId::Ecal, edm::SortedCollection< T, SORT >::end(), PV3DBase< T, PVType, FrameType >::eta(), CaloTowerTopology::firstHERing(), CaloTowerTopology::firstHFRing(), getThresholdAndWeight(), DetId::Hcal, HcalOuter, CaloTowerDetId::ietaAbs(), CaloTowerTopology::lastHBRing(), CaloTowerTopology::lastHERing(), CaloTowerTopology::lastHFRing(), CaloTowerTopology::lastHORing(), PV3DBase< T, PVType, FrameType >::phi(), edm::SortedCollection< T, SORT >::push_back(), CaloTower::setCaloTowerStatus(), CaloTower::setEcalTime(), CaloTower::setHcalSubdet(), CaloTower::setHcalTime(), HcalDetId::subdet(), theHF1weight, theHF2weight, theHOIsUsed, theTowerTopology, DiMuonV_cfg::threshold, and mps_merge::weight.

Referenced by CaloTowersReCreator::produce().

430  {
431  for (CaloTowerCollection::const_iterator ctcItr = ctc.begin(); ctcItr != ctc.end(); ++ctcItr) {
432  CaloTowerDetId twrId = ctcItr->id();
433  double newE_em = ctcItr->emEnergy();
434  double newE_had = ctcItr->hadEnergy();
435  double newE_outer = ctcItr->outerEnergy();
436 
437  double threshold = 0.0; // not used: we do not change thresholds
438  double weight = 1.0;
439 
440  // HF
441  if (ctcItr->ietaAbs() >= theTowerTopology->firstHFRing()) {
442  double E_short = 0.5 * newE_had; // from the definitions for HF
443  double E_long = newE_em + 0.5 * newE_had; //
444  // scale
445  E_long *= theHF1weight;
446  E_short *= theHF2weight;
447  // convert
448  newE_em = E_long - E_short;
449  newE_had = 2.0 * E_short;
450  }
451 
452  else { // barrel/endcap
453 
454  // find if its in EB, or EE; determine from first ecal constituent found
455  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
456  DetId constId = ctcItr->constituent(iConst);
457  if (constId.det() != DetId::Ecal)
458  continue;
460  newE_em *= weight;
461  break;
462  }
463  // HO
464  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
465  DetId constId = ctcItr->constituent(iConst);
466  if (constId.det() != DetId::Hcal)
467  continue;
468  if (HcalDetId(constId).subdet() != HcalOuter)
469  continue;
471  newE_outer *= weight;
472  break;
473  }
474  // HB/HE
475  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
476  DetId constId = ctcItr->constituent(iConst);
477  if (constId.det() != DetId::Hcal)
478  continue;
479  if (HcalDetId(constId).subdet() == HcalOuter)
480  continue;
482  newE_had *= weight;
483  if (ctcItr->ietaAbs() > theTowerTopology->firstHERing())
484  newE_outer *= weight;
485  break;
486  }
487 
488  } // barrel/endcap region
489 
490  // now make the new tower
491 
492  double newE_hadTot =
493  (theHOIsUsed && twrId.ietaAbs() <= theTowerTopology->lastHORing()) ? newE_had + newE_outer : newE_had;
494 
495  GlobalPoint emPoint = ctcItr->emPosition();
496  GlobalPoint hadPoint = ctcItr->emPosition();
497 
498  double f_em = 1.0 / cosh(emPoint.eta());
499  double f_had = 1.0 / cosh(hadPoint.eta());
500 
502 
503  if (ctcItr->ietaAbs() < theTowerTopology->firstHFRing()) {
504  if (newE_em > 0)
505  towerP4 += CaloTower::PolarLorentzVector(newE_em * f_em, emPoint.eta(), emPoint.phi(), 0);
506  if (newE_hadTot > 0)
507  towerP4 += CaloTower::PolarLorentzVector(newE_hadTot * f_had, hadPoint.eta(), hadPoint.phi(), 0);
508  } else {
509  double newE_tot = newE_em + newE_had;
510  // for HF we use common point for ecal, hcal shower positions regardless of the method
511  if (newE_tot > 0)
512  towerP4 += CaloTower::PolarLorentzVector(newE_tot * f_had, hadPoint.eta(), hadPoint.phi(), 0);
513  }
514 
515  CaloTower rescaledTower(twrId, newE_em, newE_had, newE_outer, -1, -1, towerP4, emPoint, hadPoint);
516  // copy the timings, have to convert back to int, 1 unit = 0.01 ns
517  rescaledTower.setEcalTime(int(ctcItr->ecalTime() * 100.0 + 0.5));
518  rescaledTower.setHcalTime(int(ctcItr->hcalTime() * 100.0 + 0.5));
519  //add topology info
520  rescaledTower.setHcalSubdet(theTowerTopology->lastHBRing(),
524 
525  std::vector<DetId> contains;
526  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
527  contains.push_back(ctcItr->constituent(iConst));
528  }
529  rescaledTower.addConstituents(contains);
530 
531  rescaledTower.setCaloTowerStatus(ctcItr->towerStatusWord());
532 
533  ctcResult.push_back(rescaledTower);
534 
535  } // end of loop over towers
536 }
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
int ietaAbs() const
get the absolute value of the tower ieta
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold & weight
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
T eta() const
Definition: PV3DBase.h:73
std::vector< CaloTower >::const_iterator const_iterator
Definition: weight.py:1
int lastHFRing() const
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
int lastHERing() const
int lastHORing() const
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
int firstHERing() const
const CaloTowerTopology * theTowerTopology
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
Definition: DetId.h:17
int firstHFRing() const
int lastHBRing() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38

◆ setEBEScale()

void CaloTowersCreationAlgo::setEBEScale ( double  scale)

◆ setEbHandle()

void CaloTowersCreationAlgo::setEbHandle ( const edm::Handle< EcalRecHitCollection eb)
inline

Definition at line 245 of file CaloTowersCreationAlgo.h.

References theEbHandle.

Referenced by CaloTowersCreator::produce().

245 { theEbHandle = eb; }
edm::Handle< EcalRecHitCollection > theEbHandle

◆ setEcalChStatusFromDB()

void CaloTowersCreationAlgo::setEcalChStatusFromDB ( const EcalChannelStatus s)
inline

Definition at line 169 of file CaloTowersCreationAlgo.h.

References alignCSCRings::s, and theEcalChStatus.

Referenced by CaloTowersCreator::produce().

169 { theEcalChStatus = s; }
const EcalChannelStatus * theEcalChStatus

◆ setEcalSeveritiesToBeExcluded()

void CaloTowersCreationAlgo::setEcalSeveritiesToBeExcluded ( const std::vector< int > &  ecalSev)
inline

Definition at line 211 of file CaloTowersCreationAlgo.h.

References theEcalSeveritiesToBeExcluded.

Referenced by CaloTowersCreator::produce().

211 { theEcalSeveritiesToBeExcluded = ecalSev; }
std::vector< int > theEcalSeveritiesToBeExcluded

◆ SetEcalSeveritiesToBeUsedInBadTowers()

void CaloTowersCreationAlgo::SetEcalSeveritiesToBeUsedInBadTowers ( const std::vector< int > &  ecalSev)
inline

Definition at line 233 of file CaloTowersCreationAlgo.h.

References theEcalSeveritiesToBeUsedInBadTowers.

Referenced by CaloTowersCreator::produce().

233  {
235  }
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers

◆ setEcalSevLvlAlgo()

void CaloTowersCreationAlgo::setEcalSevLvlAlgo ( const EcalSeverityLevelAlgo a)
inline

Definition at line 221 of file CaloTowersCreationAlgo.h.

References a, and theEcalSevLvlAlgo.

Referenced by CaloTowersCreator::produce().

221 { theEcalSevLvlAlgo = a; }
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
double a
Definition: hdecay.h:121

◆ setEEEScale()

void CaloTowersCreationAlgo::setEEEScale ( double  scale)

◆ setEeHandle()

void CaloTowersCreationAlgo::setEeHandle ( const edm::Handle< EcalRecHitCollection ee)
inline

Definition at line 246 of file CaloTowersCreationAlgo.h.

References theEeHandle.

Referenced by CaloTowersCreator::produce().

246 { theEeHandle = ee; }
edm::Handle< EcalRecHitCollection > theEeHandle

◆ setGeometry()

void CaloTowersCreationAlgo::setGeometry ( const CaloTowerTopology cttopo,
const CaloTowerConstituentsMap ctmap,
const HcalTopology htopo,
const CaloGeometry geo 
)

Definition at line 358 of file CaloTowersCreationAlgo.cc.

References DetId::Calo, ecalBadChs, CaloGeometry::getSubdetectorGeometry(), CaloTowerTopology::sizeForDenseIndexing(), CaloTowerDetId::SubdetId, theGeometry, theHcalTopology, theTowerConstituentsMap, theTowerGeometry, and theTowerTopology.

Referenced by CaloTowersReCreator::produce(), and CaloTowersCreator::produce().

361  {
362  theTowerTopology = cttopo;
363  theTowerConstituentsMap = ctmap;
364  theHcalTopology = htopo;
365  theGeometry = geo;
367 
368  //initialize ecal bad channel map
370 }
uint32_t sizeForDenseIndexing() const
const CaloSubdetectorGeometry * theTowerGeometry
static const int SubdetId
const CaloGeometry * theGeometry
const CaloTowerConstituentsMap * theTowerConstituentsMap
const CaloTowerTopology * theTowerTopology
const HcalTopology * theHcalTopology
std::vector< unsigned short > ecalBadChs
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ setHBEScale()

void CaloTowersCreationAlgo::setHBEScale ( double  scale)

◆ setHcalAcceptSeverityLevel()

void CaloTowersCreationAlgo::setHcalAcceptSeverityLevel ( unsigned int  level)
inline

◆ setHcalAcceptSeverityLevelForRejectedHit()

void CaloTowersCreationAlgo::setHcalAcceptSeverityLevelForRejectedHit ( unsigned int  level)
inline

◆ setHcalChStatusFromDB()

void CaloTowersCreationAlgo::setHcalChStatusFromDB ( const HcalChannelQuality s)
inline

Definition at line 168 of file CaloTowersCreationAlgo.h.

References alignCSCRings::s, and theHcalChStatus.

Referenced by CaloTowersCreator::produce().

168 { theHcalChStatus = s; }
const HcalChannelQuality * theHcalChStatus

◆ setHcalSevLvlComputer()

void CaloTowersCreationAlgo::setHcalSevLvlComputer ( const HcalSeverityLevelComputer c)
inline

◆ setHEDEScale()

void CaloTowersCreationAlgo::setHEDEScale ( double  scale)

◆ setHESEScale()

void CaloTowersCreationAlgo::setHESEScale ( double  scale)

◆ setHF1EScale()

void CaloTowersCreationAlgo::setHF1EScale ( double  scale)

◆ setHF2EScale()

void CaloTowersCreationAlgo::setHF2EScale ( double  scale)

◆ setHOEScale()

void CaloTowersCreationAlgo::setHOEScale ( double  scale)

◆ setMissingHcalRescaleFactorForEcal()

void CaloTowersCreationAlgo::setMissingHcalRescaleFactorForEcal ( float  factor)
inline

◆ setRecoveredEcalHitsAreUsed()

void CaloTowersCreationAlgo::setRecoveredEcalHitsAreUsed ( bool  flag)
inline

◆ setRecoveredHcalHitsAreUsed()

void CaloTowersCreationAlgo::setRecoveredHcalHitsAreUsed ( bool  flag)
inline

◆ setThresFromDB()

void CaloTowersCreationAlgo::setThresFromDB ( const HcalPFCuts cuts)

◆ setUseRejectedHitsOnly()

void CaloTowersCreationAlgo::setUseRejectedHitsOnly ( bool  flag)
inline

◆ setUseRejectedRecoveredEcalHits()

void CaloTowersCreationAlgo::setUseRejectedRecoveredEcalHits ( bool  flag)
inline

◆ setUseRejectedRecoveredHcalHits()

void CaloTowersCreationAlgo::setUseRejectedRecoveredHcalHits ( bool  flag)
inline

Member Data Documentation

◆ ecalBadChs

std::vector<unsigned short> CaloTowersCreationAlgo::ecalBadChs
private

Definition at line 391 of file CaloTowersCreationAlgo.h.

Referenced by convert(), makeEcalBadChs(), and setGeometry().

◆ hcalCuts

const HcalPFCuts* CaloTowersCreationAlgo::hcalCuts
private

Definition at line 325 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setThresFromDB().

◆ hcalDropChMap

HcalDropChMap CaloTowersCreationAlgo::hcalDropChMap
private

Definition at line 387 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and makeHcalDropChMap().

◆ ids_

std::vector<HcalDetId> CaloTowersCreationAlgo::ids_
private

Definition at line 405 of file CaloTowersCreationAlgo.h.

◆ missingHcalRescaleFactorForEcal

float CaloTowersCreationAlgo::missingHcalRescaleFactorForEcal
private

◆ nalgo

int CaloTowersCreationAlgo::nalgo = -1

Definition at line 54 of file CaloTowersCreationAlgo.h.

◆ theEBEScale

double CaloTowersCreationAlgo::theEBEScale
private

Definition at line 317 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEBEScale().

◆ theEBGrid

std::vector<double> CaloTowersCreationAlgo::theEBGrid
private

Definition at line 305 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEbHandle

edm::Handle<EcalRecHitCollection> CaloTowersCreationAlgo::theEbHandle
private

Definition at line 400 of file CaloTowersCreationAlgo.h.

Referenced by setEbHandle().

◆ theEBSumThreshold

double CaloTowersCreationAlgo::theEBSumThreshold
private

Definition at line 315 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theEBthreshold

double CaloTowersCreationAlgo::theEBthreshold
private

Definition at line 294 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEBweight

double CaloTowersCreationAlgo::theEBweight
private

Definition at line 313 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEBWeights

std::vector<double> CaloTowersCreationAlgo::theEBWeights
private

Definition at line 305 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEcalChStatus

const EcalChannelStatus* CaloTowersCreationAlgo::theEcalChStatus
private

Definition at line 333 of file CaloTowersCreationAlgo.h.

Referenced by setEcalChStatusFromDB().

◆ theEcalSeveritiesToBeExcluded

std::vector<int> CaloTowersCreationAlgo::theEcalSeveritiesToBeExcluded
private

◆ theEcalSeveritiesToBeUsedInBadTowers

std::vector<int> CaloTowersCreationAlgo::theEcalSeveritiesToBeUsedInBadTowers
private

◆ theEcalSevLvlAlgo

const EcalSeverityLevelAlgo* CaloTowersCreationAlgo::theEcalSevLvlAlgo
private

◆ theEcutTower

double CaloTowersCreationAlgo::theEcutTower
private

Definition at line 315 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theEEEScale

double CaloTowersCreationAlgo::theEEEScale
private

Definition at line 318 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEEEScale().

◆ theEEGrid

std::vector<double> CaloTowersCreationAlgo::theEEGrid
private

Definition at line 306 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEeHandle

edm::Handle<EcalRecHitCollection> CaloTowersCreationAlgo::theEeHandle
private

Definition at line 401 of file CaloTowersCreationAlgo.h.

Referenced by setEeHandle().

◆ theEESumThreshold

double CaloTowersCreationAlgo::theEESumThreshold
private

Definition at line 315 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theEEthreshold

double CaloTowersCreationAlgo::theEEthreshold
private

Definition at line 294 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEEweight

double CaloTowersCreationAlgo::theEEweight
private

Definition at line 313 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theEEWeights

std::vector<double> CaloTowersCreationAlgo::theEEWeights
private

Definition at line 306 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theGeometry

const CaloGeometry* CaloTowersCreationAlgo::theGeometry
private

◆ theHBEScale

double CaloTowersCreationAlgo::theHBEScale
private

Definition at line 319 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHBEScale().

◆ theHBGrid

std::vector<double> CaloTowersCreationAlgo::theHBGrid
private

Definition at line 307 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHBthreshold

double CaloTowersCreationAlgo::theHBthreshold
private

Definition at line 300 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHBthreshold1

double CaloTowersCreationAlgo::theHBthreshold1
private

Definition at line 300 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHBthreshold2

double CaloTowersCreationAlgo::theHBthreshold2
private

Definition at line 300 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHBweight

double CaloTowersCreationAlgo::theHBweight
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHBWeights

std::vector<double> CaloTowersCreationAlgo::theHBWeights
private

Definition at line 307 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHcalAcceptSeverityLevel

unsigned int CaloTowersCreationAlgo::theHcalAcceptSeverityLevel
private

◆ theHcalAcceptSeverityLevelForRejectedHit

unsigned int CaloTowersCreationAlgo::theHcalAcceptSeverityLevelForRejectedHit
private

◆ theHcalChStatus

const HcalChannelQuality* CaloTowersCreationAlgo::theHcalChStatus
private

◆ theHcalPhase

int CaloTowersCreationAlgo::theHcalPhase
private

Definition at line 403 of file CaloTowersCreationAlgo.h.

Referenced by assignHitHcal(), hadShwrPos(), and makeHcalDropChMap().

◆ theHcalSevLvlComputer

const HcalSeverityLevelComputer* CaloTowersCreationAlgo::theHcalSevLvlComputer
private

◆ theHcalThreshold

double CaloTowersCreationAlgo::theHcalThreshold
private

Definition at line 298 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theHcalTopology

const HcalTopology* CaloTowersCreationAlgo::theHcalTopology
private

◆ theHEDEScale

double CaloTowersCreationAlgo::theHEDEScale
private

Definition at line 321 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHEDEScale().

◆ theHEDGrid

std::vector<double> CaloTowersCreationAlgo::theHEDGrid
private

Definition at line 309 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHEDthreshold

double CaloTowersCreationAlgo::theHEDthreshold
private

Definition at line 302 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHEDthreshold1

double CaloTowersCreationAlgo::theHEDthreshold1
private

Definition at line 302 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHEDweight

double CaloTowersCreationAlgo::theHEDweight
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHEDWeights

std::vector<double> CaloTowersCreationAlgo::theHEDWeights
private

Definition at line 309 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHESEScale

double CaloTowersCreationAlgo::theHESEScale
private

Definition at line 320 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHESEScale().

◆ theHESGrid

std::vector<double> CaloTowersCreationAlgo::theHESGrid
private

Definition at line 308 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHESthreshold

double CaloTowersCreationAlgo::theHESthreshold
private

Definition at line 301 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHESthreshold1

double CaloTowersCreationAlgo::theHESthreshold1
private

Definition at line 301 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHESweight

double CaloTowersCreationAlgo::theHESweight
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHESWeights

std::vector<double> CaloTowersCreationAlgo::theHESWeights
private

Definition at line 308 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHF1EScale

double CaloTowersCreationAlgo::theHF1EScale
private

Definition at line 323 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF1EScale().

◆ theHF1Grid

std::vector<double> CaloTowersCreationAlgo::theHF1Grid
private

Definition at line 311 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHF1threshold

double CaloTowersCreationAlgo::theHF1threshold
private

Definition at line 304 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHF1weight

double CaloTowersCreationAlgo::theHF1weight
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

◆ theHF1Weights

std::vector<double> CaloTowersCreationAlgo::theHF1Weights
private

Definition at line 311 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHF2EScale

double CaloTowersCreationAlgo::theHF2EScale
private

Definition at line 324 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF2EScale().

◆ theHF2Grid

std::vector<double> CaloTowersCreationAlgo::theHF2Grid
private

Definition at line 312 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHF2threshold

double CaloTowersCreationAlgo::theHF2threshold
private

Definition at line 304 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHF2weight

double CaloTowersCreationAlgo::theHF2weight
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

◆ theHF2Weights

std::vector<double> CaloTowersCreationAlgo::theHF2Weights
private

Definition at line 312 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOEScale

double CaloTowersCreationAlgo::theHOEScale
private

Definition at line 322 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHOEScale().

◆ theHOGrid

std::vector<double> CaloTowersCreationAlgo::theHOGrid
private

Definition at line 310 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOIsUsed

bool CaloTowersCreationAlgo::theHOIsUsed
private

only affects energy and ET calculation. HO is still recorded in the tower

Definition at line 364 of file CaloTowersCreationAlgo.h.

Referenced by assignHitHcal(), convert(), and rescaleTowers().

◆ theHOthreshold0

double CaloTowersCreationAlgo::theHOthreshold0
private

Definition at line 303 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOthresholdMinus1

double CaloTowersCreationAlgo::theHOthresholdMinus1
private

Definition at line 303 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOthresholdMinus2

double CaloTowersCreationAlgo::theHOthresholdMinus2
private

Definition at line 304 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOthresholdPlus1

double CaloTowersCreationAlgo::theHOthresholdPlus1
private

Definition at line 303 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOthresholdPlus2

double CaloTowersCreationAlgo::theHOthresholdPlus2
private

Definition at line 304 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOweight

double CaloTowersCreationAlgo::theHOweight
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theHOWeights

std::vector<double> CaloTowersCreationAlgo::theHOWeights
private

Definition at line 310 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

◆ theMomConstrMethod

int CaloTowersCreationAlgo::theMomConstrMethod
private

Definition at line 368 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theMomEBDepth

double CaloTowersCreationAlgo::theMomEBDepth
private

Definition at line 371 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theMomEEDepth

double CaloTowersCreationAlgo::theMomEEDepth
private

Definition at line 372 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theMomHBDepth

double CaloTowersCreationAlgo::theMomHBDepth
private

Definition at line 369 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theMomHEDepth

double CaloTowersCreationAlgo::theMomHEDepth
private

Definition at line 370 of file CaloTowersCreationAlgo.h.

Referenced by convert().

◆ theRecoveredEcalHitsAreUsed

bool CaloTowersCreationAlgo::theRecoveredEcalHitsAreUsed
private

◆ theRecoveredHcalHitsAreUsed

bool CaloTowersCreationAlgo::theRecoveredHcalHitsAreUsed
private

◆ theTowerConstituentsMap

const CaloTowerConstituentsMap* CaloTowersCreationAlgo::theTowerConstituentsMap
private

◆ theTowerGeometry

const CaloSubdetectorGeometry* CaloTowersCreationAlgo::theTowerGeometry
private

Definition at line 330 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and setGeometry().

◆ theTowerMap

MetaTowerMap CaloTowersCreationAlgo::theTowerMap
private

Definition at line 381 of file CaloTowersCreationAlgo.h.

Referenced by begin(), find(), and finish().

◆ theTowerMapSize

unsigned int CaloTowersCreationAlgo::theTowerMapSize = 0
private

Definition at line 382 of file CaloTowersCreationAlgo.h.

Referenced by begin(), find(), and finish().

◆ theTowerTopology

const CaloTowerTopology* CaloTowersCreationAlgo::theTowerTopology
private

◆ theUseEtEBTresholdFlag

bool CaloTowersCreationAlgo::theUseEtEBTresholdFlag
private

Definition at line 295 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

◆ theUseEtEETresholdFlag

bool CaloTowersCreationAlgo::theUseEtEETresholdFlag
private

Definition at line 295 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

◆ theUseSymEBTresholdFlag

bool CaloTowersCreationAlgo::theUseSymEBTresholdFlag
private

Definition at line 296 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

◆ theUseSymEETresholdFlag

bool CaloTowersCreationAlgo::theUseSymEETresholdFlag
private

Definition at line 296 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

◆ useRejectedHitsOnly

bool CaloTowersCreationAlgo::useRejectedHitsOnly
private

◆ useRejectedRecoveredEcalHits

unsigned int CaloTowersCreationAlgo::useRejectedRecoveredEcalHits
private

◆ useRejectedRecoveredHcalHits

unsigned int CaloTowersCreationAlgo::useRejectedRecoveredHcalHits
private