CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 HESthreshold, double HEDthreshold, 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)
 
 CaloTowersCreationAlgo (double EBthreshold, double EEthreshold, bool useEtEBTreshold, bool useEtEETreshold, bool useSymEBTreshold, bool useSymEETreshold, double HcalThreshold, double HBthreshold, double HESthreshold, double HEDthreshold, 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)
 
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 CaloTowerConstituentsMap *cttopo, 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 setRecoveredEcalHitsAreUsed (bool flag)
 
void setRecoveredHcalHitsAreUsed (bool flag)
 
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, int > 
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

unsigned short ecalBadChs [CaloTowerDetId::kSizeForDenseIndexing]
 
HcalDropChMap hcalDropChMap
 
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 theHBweight
 
std::vector< double > theHBWeights
 
unsigned int theHcalAcceptSeverityLevel
 
unsigned int theHcalAcceptSeverityLevelForRejectedHit
 
const HcalChannelQualitytheHcalChStatus
 
const HcalSeverityLevelComputertheHcalSevLvlComputer
 
double theHcalThreshold
 
const HcalTopologytheHcalTopology
 
double theHEDEScale
 
std::vector< double > theHEDGrid
 
double theHEDthreshold
 
double theHEDweight
 
std::vector< double > theHEDWeights
 
double theHESEScale
 
std::vector< double > theHESGrid
 
double theHESthreshold
 
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
 
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 48 of file CaloTowersCreationAlgo.h.

Member Typedef Documentation

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

Definition at line 333 of file CaloTowersCreationAlgo.h.

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

Definition at line 327 of file CaloTowersCreationAlgo.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CaloTowersCreationAlgo::CaloTowersCreationAlgo ( )

Definition at line 10 of file CaloTowersCreationAlgo.cc.

11  : theEBthreshold(-1000.),
12  theEEthreshold(-1000.),
13 
18 
19 
20  theHcalThreshold(-1000.),
21  theHBthreshold(-1000.),
22  theHESthreshold(-1000.),
23  theHEDthreshold(-1000.),
24  theHOthreshold0(-1000.),
25  theHOthresholdPlus1(-1000.),
26  theHOthresholdMinus1(-1000.),
27  theHOthresholdPlus2(-1000.),
28  theHOthresholdMinus2(-1000.),
29  theHF1threshold(-1000.),
30  theHF2threshold(-1000.),
31  theEBGrid(std::vector<double>(5,10.)),
32  theEBWeights(std::vector<double>(5,1.)),
33  theEEGrid(std::vector<double>(5,10.)),
34  theEEWeights(std::vector<double>(5,1.)),
35  theHBGrid(std::vector<double>(5,10.)),
36  theHBWeights(std::vector<double>(5,1.)),
37  theHESGrid(std::vector<double>(5,10.)),
38  theHESWeights(std::vector<double>(5,1.)),
39  theHEDGrid(std::vector<double>(5,10.)),
40  theHEDWeights(std::vector<double>(5,1.)),
41  theHOGrid(std::vector<double>(5,10.)),
42  theHOWeights(std::vector<double>(5,1.)),
43  theHF1Grid(std::vector<double>(5,10.)),
44  theHF1Weights(std::vector<double>(5,1.)),
45  theHF2Grid(std::vector<double>(5,10.)),
46  theHF2Weights(std::vector<double>(5,1.)),
47  theEBweight(1.),
48  theEEweight(1.),
49  theHBweight(1.),
50  theHESweight(1.),
51  theHEDweight(1.),
52  theHOweight(1.),
53  theHF1weight(1.),
54  theHF2weight(1.),
55  theEcutTower(-1000.),
56  theEBSumThreshold(-1000.),
57  theEESumThreshold(-1000.),
58  theHcalTopology(0),
59  theGeometry(0),
61  theHOIsUsed(true),
62  // (for momentum reconstruction algorithm)
64  theMomHBDepth(0.),
65  theMomHEDepth(0.),
66  theMomEBDepth(0.),
67  theMomEEDepth(0.)
68 {
69 }
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
std::vector< double > theEBWeights
CaloTowersCreationAlgo::CaloTowersCreationAlgo ( double  EBthreshold,
double  EEthreshold,
bool  useEtEBTreshold,
bool  useEtEETreshold,
bool  useSymEBTreshold,
bool  useSymEETreshold,
double  HcalThreshold,
double  HBthreshold,
double  HESthreshold,
double  HEDthreshold,
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 
)

Definition at line 71 of file CaloTowersCreationAlgo.cc.

95  : theEBthreshold(EBthreshold),
96  theEEthreshold(EEthreshold),
97 
98  theUseEtEBTresholdFlag(useEtEBTreshold),
99  theUseEtEETresholdFlag(useEtEETreshold),
100  theUseSymEBTresholdFlag(useSymEBTreshold),
101  theUseSymEETresholdFlag(useSymEETreshold),
102 
104  theHBthreshold(HBthreshold),
105  theHESthreshold(HESthreshold),
106  theHEDthreshold(HEDthreshold),
107  theHOthreshold0(HOthreshold0),
108  theHOthresholdPlus1(HOthresholdPlus1),
109  theHOthresholdMinus1(HOthresholdMinus1),
110  theHOthresholdPlus2(HOthresholdPlus2),
111  theHOthresholdMinus2(HOthresholdMinus2),
112  theHF1threshold(HF1threshold),
113  theHF2threshold(HF2threshold),
114  theEBGrid(std::vector<double>(5,10.)),
115  theEBWeights(std::vector<double>(5,1.)),
116  theEEGrid(std::vector<double>(5,10.)),
117  theEEWeights(std::vector<double>(5,1.)),
118  theHBGrid(std::vector<double>(5,10.)),
119  theHBWeights(std::vector<double>(5,1.)),
120  theHESGrid(std::vector<double>(5,10.)),
121  theHESWeights(std::vector<double>(5,1.)),
122  theHEDGrid(std::vector<double>(5,10.)),
123  theHEDWeights(std::vector<double>(5,1.)),
124  theHOGrid(std::vector<double>(5,10.)),
125  theHOWeights(std::vector<double>(5,1.)),
126  theHF1Grid(std::vector<double>(5,10.)),
127  theHF1Weights(std::vector<double>(5,1.)),
128  theHF2Grid(std::vector<double>(5,10.)),
129  theHF2Weights(std::vector<double>(5,1.)),
130  theEBweight(EBweight),
131  theEEweight(EEweight),
132  theHBweight(HBweight),
133  theHESweight(HESweight),
134  theHEDweight(HEDweight),
135  theHOweight(HOweight),
136  theHF1weight(HF1weight),
137  theHF2weight(HF2weight),
142  // (momentum reconstruction algorithm)
143  theMomConstrMethod(momConstrMethod),
144  theMomHBDepth(momHBDepth),
145  theMomHEDepth(momHEDepth),
146  theMomEBDepth(momEBDepth),
147  theMomEEDepth(momEEDepth)
148 
149 {
150 }
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
std::vector< double > theHOGrid
std::vector< double > theHF1Weights
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
std::vector< double > theHBWeights
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
std::vector< double > theEBWeights
CaloTowersCreationAlgo::CaloTowersCreationAlgo ( double  EBthreshold,
double  EEthreshold,
bool  useEtEBTreshold,
bool  useEtEETreshold,
bool  useSymEBTreshold,
bool  useSymEETreshold,
double  HcalThreshold,
double  HBthreshold,
double  HESthreshold,
double  HEDthreshold,
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 
)

Definition at line 152 of file CaloTowersCreationAlgo.cc.

183  : theEBthreshold(EBthreshold),
184  theEEthreshold(EEthreshold),
185 
186  theUseEtEBTresholdFlag(useEtEBTreshold),
187  theUseEtEETresholdFlag(useEtEETreshold),
188  theUseSymEBTresholdFlag(useSymEBTreshold),
189  theUseSymEETresholdFlag(useSymEETreshold),
190 
192  theHBthreshold(HBthreshold),
193  theHESthreshold(HESthreshold),
194  theHEDthreshold(HEDthreshold),
195  theHOthreshold0(HOthreshold0),
196  theHOthresholdPlus1(HOthresholdPlus1),
197  theHOthresholdMinus1(HOthresholdMinus1),
198  theHOthresholdPlus2(HOthresholdPlus2),
199  theHOthresholdMinus2(HOthresholdMinus2),
200  theHF1threshold(HF1threshold),
201  theHF2threshold(HF2threshold),
202  theEBGrid(EBGrid),
204  theEEGrid(EEGrid),
206  theHBGrid(HBGrid),
212  theHOGrid(HOGrid),
218  theEBweight(EBweight),
219  theEEweight(EEweight),
220  theHBweight(HBweight),
221  theHESweight(HESweight),
222  theHEDweight(HEDweight),
223  theHOweight(HOweight),
224  theHF1weight(HF1weight),
225  theHF2weight(HF2weight),
230  // (momentum reconstruction algorithm)
231  theMomConstrMethod(momConstrMethod),
232  theMomHBDepth(momHBDepth),
233  theMomHEDepth(momHEDepth),
234  theMomEBDepth(momEBDepth),
235  theMomEEDepth(momEEDepth)
236 
237 {
238  // static int N = 0;
239  // std::cout << "VI Algo " << ++N << std::endl;
240  // nalgo=N;
241 }
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
std::vector< double > theHOGrid
std::vector< double > theHF1Weights
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
std::vector< double > theHBWeights
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
std::vector< double > theEBWeights

Member Function Documentation

void CaloTowersCreationAlgo::assignHitEcal ( const EcalRecHit recHit)
private

adds a single hit to the tower

Definition at line 634 of file CaloTowersCreationAlgo.cc.

References BadChan, EcalRecHit::detid(), alignCSCRings::e, CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_em, EcalBarrel, ecalChanStatusForCaloTower(), EcalEndcap, CaloTowersCreationAlgo::MetaTower::emSumEForTime, CaloTowersCreationAlgo::MetaTower::emSumTimeTimesE, relval_parameters_module::energy, EcalRecHit::energy(), eta, spr::find(), find(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), getThresholdAndWeight(), GoodChan, IgnoredChan, CaloTowersCreationAlgo::MetaTower::metaConstituents, DetId::null(), CaloTowersCreationAlgo::MetaTower::numBadEcalCells, CaloTowersCreationAlgo::MetaTower::numProbEcalCells, CaloTowersCreationAlgo::MetaTower::numRecEcalCells, ProblematicChan, RecoveredChan, EcalSeverityLevelAlgo::severityLevel(), DetId::subdetId(), theEcalSeveritiesToBeExcluded, theEcalSevLvlAlgo, theGeometry, theTowerConstituentsMap, theUseEtEBTresholdFlag, theUseEtEETresholdFlag, theUseSymEBTresholdFlag, theUseSymEETresholdFlag, dtDQMClient_cfg::threshold, EcalRecHit::time(), CaloTowerConstituentsMap::towerOf(), and histoStyle::weight.

Referenced by process().

634  {
635  DetId detId = recHit->detid();
636 
637  unsigned int chStatusForCT;
638  bool ecalIsBad=false;
639  std::tie(chStatusForCT,ecalIsBad) = ecalChanStatusForCaloTower(recHit);
640 
641  // this is for skipping channls: mostly needed for the creation of
642  // bad towers from hits i the bad channel collections.
643  if (chStatusForCT==CaloTowersCreationAlgo::IgnoredChan) return;
644 
645  double threshold, weight;
646  getThresholdAndWeight(detId, threshold, weight);
647 
648  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
649  double e = energy * weight; // energies scaled by user weight: used in energy assignments
650 
652 
653  // For ECAL we count all bad channels after the metatower is complete
654 
655  // Include options for symmetric thresholds and cut on Et
656  // for ECAL RecHits
657 
658  bool passEmThreshold = false;
659 
660  if (detId.subdetId() == EcalBarrel) {
661  if (theUseEtEBTresholdFlag) energy /= cosh( (theGeometry->getGeometry(detId)->getPosition()).eta() ) ;
662  if (theUseSymEBTresholdFlag) passEmThreshold = (fabs(energy) >= threshold);
663  else passEmThreshold = (energy >= threshold);
664 
665  }
666  else if (detId.subdetId() == EcalEndcap) {
667  if (theUseEtEETresholdFlag) energy /= cosh( (theGeometry->getGeometry(detId)->getPosition()).eta() ) ;
668  if (theUseSymEETresholdFlag) passEmThreshold = (fabs(energy) >= threshold);
669  else passEmThreshold = (energy >= threshold);
670  }
671 
672  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
673  if (towerDetId.null()) return;
674  MetaTower & tower = find(towerDetId);
675 
676 
677  // count bad cells and avoid double counting with those from DB (Recovered are counted bad)
678 
679  // somehow misses some
680  // if ( (chStatusForCT == CaloTowersCreationAlgo::BadChan) & (!ecalIsBad) ) ++tower.numBadEcalCells;
681 
682  // a bit slower...
683  if ( chStatusForCT == CaloTowersCreationAlgo::BadChan ) {
684  auto thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel(detId);
685  // check if the Ecal severity is ok to keep
686  auto sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
688  thisEcalSevLvl);
689  if (sevit==theEcalSeveritiesToBeExcluded.end()) ++tower.numBadEcalCells; // notinDB
690  }
691 
692 
693  // if (chStatusForCT != CaloTowersCreationAlgo::BadChan && energy >= threshold) {
694  if (chStatusForCT != CaloTowersCreationAlgo::BadChan && passEmThreshold) {
695 
696  tower.E_em += e;
697  tower.E += e;
698 
699  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
700  tower.numRecEcalCells += 1;
701  }
702  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
703  tower.numProbEcalCells += 1;
704  }
705 
706  // change when full status info is available
707  // for now use only good channels
708 
709  // add e>0 check (new options allow e<0)
710  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan && e>0 ) {
711  tower.emSumTimeTimesE += ( e * recHit->time() );
712  tower.emSumEForTime += e; // see above
713  }
714 
715  std::pair<DetId,float> mc(detId,e);
716  tower.metaConstituents.push_back(mc);
717  }
718 } // end of assignHitEcal method
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
const DetId & detid() const
Definition: EcalRecHit.h:71
float time() const
Definition: EcalRecHit.h:70
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:7
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
const CaloGeometry * theGeometry
float energy() const
Definition: EcalRecHit.h:68
const CaloTowerConstituentsMap * theTowerConstituentsMap
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
bool null() const
is this a null id ?
Definition: DetId.h:45
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold &amp; weight
std::vector< int > theEcalSeveritiesToBeExcluded
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
int weight
Definition: histoStyle.py:50
std::tuple< unsigned int, bool > ecalChanStatusForCaloTower(const EcalRecHit *hit)
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
void CaloTowersCreationAlgo::assignHitHcal ( const CaloRecHit recHit)
private

Definition at line 417 of file CaloTowersCreationAlgo.cc.

References BadChan, HcalDetId::depth(), DetId::det(), CaloRecHit::detid(), alignCSCRings::e, CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_em, CaloTowersCreationAlgo::MetaTower::E_had, CaloTowersCreationAlgo::MetaTower::E_outer, CaloRecHit::energy(), relval_parameters_module::energy, find(), getThresholdAndWeight(), GoodChan, CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalChanStatusForCaloTower(), HcalEndcap, HcalForward, HcalOuter, CaloTowerDetId::ieta(), HcalDetId::ietaAbs(), IgnoredChan, CaloTowerDetId::iphi(), CaloTowersCreationAlgo::MetaTower::metaConstituents, DetId::null(), CaloTowersCreationAlgo::MetaTower::numBadHcalCells, CaloTowersCreationAlgo::MetaTower::numProbHcalCells, CaloTowersCreationAlgo::MetaTower::numRecHcalCells, ProblematicChan, RecoveredChan, HcalDetId::subdet(), theHOIsUsed, theTowerConstituentsMap, dtDQMClient_cfg::threshold, CaloRecHit::time(), CaloTowerConstituentsMap::towerOf(), histoStyle::weight, and CaloTowerDetId::zside().

Referenced by process().

417  {
418  DetId detId = recHit->detid();
419 
420  unsigned int chStatusForCT = hcalChanStatusForCaloTower(recHit);
421 
422  // this is for skipping channls: mostly needed for the creation of
423  // bad towers from hits i the bad channel collections.
424  if (chStatusForCT==CaloTowersCreationAlgo::IgnoredChan) return;
425 
426  double threshold, weight;
427  getThresholdAndWeight(detId, threshold, weight);
428 
429  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
430  double e = energy * weight; // energies scaled by user weight: used in energy assignments
431 
432  // SPECIAL handling of tower 28/depth 3 --> half into tower 28 and half into tower 29
433  if (detId.det()==DetId::Hcal &&
434  HcalDetId(detId).subdet()==HcalEndcap &&
435  HcalDetId(detId).depth()==3 &&
436  HcalDetId(detId).ietaAbs()==28) {
437 
439 
440  // bad channels are counted regardless of energy threshold
441 
442  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
443  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
444  if (towerDetId.null()) return;
445  MetaTower & tower28 = find(towerDetId);
446  CaloTowerDetId towerDetId29(towerDetId.ieta()+towerDetId.zside(),
447  towerDetId.iphi());
448  MetaTower & tower29 = find(towerDetId29);
449  tower28.numBadHcalCells += 1;
450  tower29.numBadHcalCells += 1;
451  }
452 
453  else if (0.5*energy >= threshold) { // not bad channel: use energy if above threshold
454 
455  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
456  if (towerDetId.null()) return;
457  MetaTower & tower28 = find(towerDetId);
458  CaloTowerDetId towerDetId29(towerDetId.ieta()+towerDetId.zside(),
459  towerDetId.iphi());
460  MetaTower & tower29 = find(towerDetId29);
461 
462  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
463  tower28.numRecHcalCells += 1;
464  tower29.numRecHcalCells += 1;
465  }
466  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
467  tower28.numProbHcalCells += 1;
468  tower29.numProbHcalCells += 1;
469  }
470 
471  // NOTE DIVIDE BY 2!!!
472  double e28 = 0.5 * e;
473  double e29 = 0.5 * e;
474 
475  tower28.E_had += e28;
476  tower28.E += e28;
477  std::pair<DetId,float> mc(detId,e28);
478  tower28.metaConstituents.push_back(mc);
479 
480  tower29.E_had += e29;
481  tower29.E += e29;
482  tower29.metaConstituents.push_back(mc);
483 
484  // time info: do not use in averaging if timing error is found: need
485  // full set of status info to implement: use only "good" channels for now
486 
487  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
488  tower28.hadSumTimeTimesE += ( e28 * recHit->time() );
489  tower28.hadSumEForTime += e28;
490  tower29.hadSumTimeTimesE += ( e29 * recHit->time() );
491  tower29.hadSumEForTime += e29;
492  }
493 
494  // store the energy in layer 3 also in E_outer
495  tower28.E_outer += e28;
496  tower29.E_outer += e29;
497  } // not a "bad" hit
498 
499  } // end of special case
500 
501  else {
502  HcalDetId hcalDetId(detId);
503 
505 
506  if(hcalDetId.subdet() == HcalOuter) {
507 
508  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
509  if (towerDetId.null()) return;
510  MetaTower & tower = find(towerDetId);
511 
512  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
513  if (theHOIsUsed) tower.numBadHcalCells += 1;
514  }
515 
516  else if (energy >= threshold) {
517  tower.E_outer += e; // store HO energy even if HO is not used
518  // add energy of the tower and/or flag if theHOIsUsed
519  if(theHOIsUsed) {
520  tower.E += e;
521 
522  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
523  tower.numRecHcalCells += 1;
524  }
525  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
526  tower.numProbHcalCells += 1;
527  }
528  } // HO is used
529 
530 
531  // add HO to constituents even if it is not used: JetMET wants to keep these towers
532  std::pair<DetId,float> mc(detId,e);
533  tower.metaConstituents.push_back(mc);
534 
535  } // not a bad channel, energy above threshold
536 
537  } // HO hit
538 
539  // HF calculates EM fraction differently
540  else if(hcalDetId.subdet() == HcalForward) {
541 
542  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
543  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
544  if (towerDetId.null()) return;
545  MetaTower & tower = find(towerDetId);
546  tower.numBadHcalCells += 1;
547  }
548 
549  else if (energy >= threshold) {
550  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
551  if (towerDetId.null()) return;
552  MetaTower & tower = find(towerDetId);
553 
554  if (hcalDetId.depth() == 1) {
555  // long fiber, so E_EM = E(Long) - E(Short)
556  tower.E_em += e;
557  }
558  else {
559  // short fiber, EHAD = 2 * E(Short)
560  tower.E_em -= e;
561  tower.E_had += 2. * e;
562  }
563  tower.E += e;
564  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
565  tower.numRecHcalCells += 1;
566  }
567  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
568  tower.numProbHcalCells += 1;
569  }
570 
571  // put the timing in HCAL -> have to check timing errors when available
572  // for now use only good channels
573  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
574  tower.hadSumTimeTimesE += ( e * recHit->time() );
575  tower.hadSumEForTime += e;
576  }
577 
578  std::pair<DetId,float> mc(detId,e);
579  tower.metaConstituents.push_back(mc);
580 
581  } // not a bad HF channel, energy above threshold
582 
583  } // HF hit
584 
585  else {
586  // HCAL situation normal in HB/HE
587  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
588  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
589  if (towerDetId.null()) return;
590  MetaTower & tower = find(towerDetId);
591  tower.numBadHcalCells += 1;
592  }
593  else if (energy >= threshold) {
594  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
595  if (towerDetId.null()) return;
596  MetaTower & tower = find(towerDetId);
597  tower.E_had += e;
598  tower.E += e;
599  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
600  tower.numRecHcalCells += 1;
601  }
602  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
603  tower.numProbHcalCells += 1;
604  }
605 
606  // Timing information: need specific accessors
607  // for now use only good channels
608  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
609  tower.hadSumTimeTimesE += ( e * recHit->time() );
610  tower.hadSumEForTime += e;
611  }
612  // store energy in highest depth for towers 18-27 (for electron,photon ID in endcap)
613  // also, store energy in HE part of tower 16 (for JetMET cleanup)
614  HcalDetId hcalDetId(detId);
615  if (hcalDetId.subdet()==HcalEndcap) {
616  if ( (hcalDetId.depth()==2 && hcalDetId.ietaAbs()>=18 && hcalDetId.ietaAbs()<27) ||
617  (hcalDetId.depth()==3 && hcalDetId.ietaAbs()==27) ||
618  (hcalDetId.depth()==3 && hcalDetId.ietaAbs()==16) ) {
619  tower.E_outer += e;
620  }
621  }
622 
623  std::pair<DetId,float> mc(detId,e);
624  tower.metaConstituents.push_back(mc);
625 
626  } // not a "bad" channel, energy above threshold
627 
628  } // channel in HBHE (excluding twrs 28,29)
629 
630  } // recHit normal case (not in HE towers 28,29)
631 
632 } // end of assignHitHcal method
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
const DetId & detid() const
Definition: CaloRecHit.h:20
MetaTower & find(const CaloTowerDetId &id)
looks for a given tower in the internal cache. If it can&#39;t find it, it makes it.
float time() const
Definition: CaloRecHit.h:19
int depth() const
get the tower depth
Definition: HcalDetId.h:55
unsigned int hcalChanStatusForCaloTower(const CaloRecHit *hit)
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
float energy() const
Definition: CaloRecHit.h:17
int iphi() const
get the tower iphi
const CaloTowerConstituentsMap * theTowerConstituentsMap
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:49
Definition: DetId.h:18
bool null() const
is this a null id ?
Definition: DetId.h:45
int zside() const
get the z-side of the tower (1/-1)
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold &amp; weight
int ieta() const
get the tower ieta
int weight
Definition: histoStyle.py:50
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
void CaloTowersCreationAlgo::begin ( void  )

Definition at line 251 of file CaloTowersCreationAlgo.cc.

References theTowerMap, and theTowerMapSize.

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

251  {
252  theTowerMap.clear();
253  theTowerMapSize=0;
254  //hcalDropChMap.clear();
255 }
int CaloTowersCreationAlgo::compactTime ( float  time)
private

Definition at line 1436 of file CaloTowersCreationAlgo.cc.

Referenced by convert().

1436  {
1437 
1438  const float timeUnit = 0.01; // discretization (ns)
1439 
1440  if (time> 300.0) return 30000;
1441  if (time< -300.0) return -30000;
1442 
1443  return int(time/timeUnit + 0.5);
1444 
1445 }
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 789 of file CaloTowersCreationAlgo.cc.

References assert(), edm::SortedCollection< T, SORT >::back(), PV3DBase< T, PVType, FrameType >::basicVector(), compactTime(), edm::contains(), diffTreeTool::diff, CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_em, CaloTowersCreationAlgo::MetaTower::E_had, CaloTowersCreationAlgo::MetaTower::E_outer, DetId::Ecal, ecalBadChs, emShwrLogWeightPos(), emShwrPos(), CaloTowersCreationAlgo::MetaTower::emSumEForTime, CaloTowersCreationAlgo::MetaTower::emSumTimeTimesE, PV3DBase< T, PVType, FrameType >::eta(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), hadShwrPos(), CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalDropChMap, HcalOuter, i, if(), CaloTowersCreationAlgo::MetaTower::metaConstituents, CaloTowersCreationAlgo::MetaTower::numBadEcalCells, CaloTowersCreationAlgo::MetaTower::numBadHcalCells, CaloTowersCreationAlgo::MetaTower::numProbEcalCells, CaloTowersCreationAlgo::MetaTower::numProbHcalCells, CaloTowersCreationAlgo::MetaTower::numRecEcalCells, CaloTowersCreationAlgo::MetaTower::numRecHcalCells, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::phi(), edm::SortedCollection< T, SORT >::pop_back(), edm::second(), mathSSE::sqrt(), HcalDetId::subdet(), theEBSumThreshold, theEcutTower, theEESumThreshold, theHcalThreshold, theHOIsUsed, theMomConstrMethod, theMomEBDepth, theMomEEDepth, theMomHBDepth, theMomHEDepth, theTowerGeometry, Basic3DVector< T >::unit(), and unlikely.

Referenced by finish().

791 {
792  assert(id.rawId()!=0);
793 
794  double ecalThres=(id.ietaAbs()<=17)?(theEBSumThreshold):(theEESumThreshold);
795  double E=mt.E;
796  double E_em=mt.E_em;
797  double E_had=mt.E_had;
798  double E_outer=mt.E_outer;
799 
800  // Note: E_outer is used to save HO energy OR energy in the outermost depths in endcap region
801  // In the methods with separate treatment of EM and HAD components:
802  // - HO is not used to determine direction, however HO energy is added to get "total had energy"
803  // => Check if the tower is within HO coverage before adding E_outer to the "total had" energy
804  // else the energy will be double counted
805  // When summing up the energy of the tower these checks are performed in the loops over RecHits
806 
807  std::vector<std::pair<DetId,float> > metaContains=mt.metaConstituents;
808  if (id.ietaAbs()<=29 && E_em<ecalThres) { // ignore EM threshold in HF
809  E-=E_em;
810  E_em=0;
811  std::vector<std::pair<DetId,float> > metaContains_noecal;
812 
813  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i)
814  if (i->first.det()!=DetId::Ecal) metaContains_noecal.push_back(*i);
815  metaContains.swap(metaContains_noecal);
816  }
817  if (id.ietaAbs()<=29 && E_had<theHcalThreshold) {
818  E-=E_had;
819 
820  if (theHOIsUsed && id.ietaAbs()<16) E-=E_outer; // not subtracted before, think it should be done
821 
822  E_had=0;
823  E_outer=0;
824  std::vector<std::pair<DetId,float> > metaContains_nohcal;
825 
826  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i)
827  if (i->first.det()!=DetId::Hcal) metaContains_nohcal.push_back(*i);
828  metaContains.swap(metaContains_nohcal);
829  }
830 
831  if(metaContains.empty()) return;
832 
833  double E_had_tot = (theHOIsUsed && id.ietaAbs()<16)? E_had+E_outer : E_had;
834 
835 
836  // create CaloTower using the selected algorithm
837 
838  GlobalPoint emPoint, hadPoint;
839 
840  // this is actually a 4D vector
841  Basic3DVectorF towerP4;
842  bool massless=true;
843  // float mass1=0;
844  float mass2=0;
845 
846  // conditional assignment of depths for barrel/endcap
847  // Some additional tuning may be required in the transitional region
848  // 14<|iEta|<19
849  double momEmDepth = 0.;
850  double momHadDepth = 0.;
851  if (id.ietaAbs()<=17) {
852  momHadDepth = theMomHBDepth;
853  momEmDepth = theMomEBDepth;
854  }
855  else {
856  momHadDepth = theMomHEDepth;
857  momEmDepth = theMomEEDepth;
858  }
859 
860 
861 
862  switch (theMomConstrMethod) {
863 
864  // FIXME : move to simple cartesian algebra
865  case 0 :
866  { // Simple 4-momentum assignment
868  towerP4 = p.basicVector().unit();
869  towerP4[3] = 1.f; // energy
870  towerP4 *=E;
871 
872  // double pf=1.0/cosh(p.eta());
873  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0);
874 
875  emPoint = p;
876  hadPoint = p;
877  } // end case 0
878  break;
879 
880  case 1 :
881  { // separate 4-vectors for ECAL, HCAL, add to get the 4-vector of the tower (=>tower has mass!)
882  if (id.ietaAbs()<=29) {
883  Basic3DVectorF emP4;
884  if (E_em>0) {
885  emPoint = emShwrPos(metaContains, momEmDepth, E_em);
886  emP4 = emPoint.basicVector().unit();
887  emP4[3] = 1.f; // energy
888  towerP4 = emP4*E_em;
889 
890  // double emPf = 1.0/cosh(emPoint.eta());
891  // towerP4 += CaloTower::PolarLorentzVector(E_em*emPf, emPoint.eta(), emPoint.phi(), 0);
892  }
893  if ( (E_had + E_outer) >0) {
894  massless = (E_em<=0);
895  hadPoint = hadShwrPos(id, momHadDepth);
896  auto lP4 = hadPoint.basicVector().unit();
897  lP4[3] = 1.f; // energy
898  if (!massless) {
899  auto diff = lP4-emP4; mass2 = std::sqrt(E_em*E_had_tot*diff.mag2());
900  }
901  lP4 *=E_had_tot;
902  towerP4 +=lP4;
903  /*
904  if (!massless) {
905  auto p = towerP4;
906  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;
907  }
908  */
909  // double hadPf = 1.0/cosh(hadPoint.eta());
910  // if (E_had_tot>0) {
911  // towerP4 += CaloTower::PolarLorentzVector(E_had_tot*hadPf, hadPoint.eta(), hadPoint.phi(), 0);
912  // }
913  }
914  }
915  else { // forward detector: use the CaloTower position
917  towerP4 = p.basicVector().unit();
918  towerP4[3] = 1.f; // energy
919  towerP4 *=E;
920  // double pf=1.0/cosh(p.eta());
921  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
922  emPoint = p;
923  hadPoint = p;
924  }
925  } // end case 1
926  break;
927 
928  case 2:
929  { // use ECAL position for the tower (when E_cal>0), else default CaloTower position (massless tower)
930  if (id.ietaAbs()<=29) {
931  if (E_em>0) emPoint = emShwrLogWeightPos(metaContains, momEmDepth, E_em);
932  else emPoint = theTowerGeometry->getGeometry(id)->getPosition();
933  towerP4 = emPoint.basicVector().unit();
934  towerP4[3] = 1.f; // energy
935  towerP4 *=E;
936 
937  // double sumPf = 1.0/cosh(emPoint.eta());
939 
940  hadPoint = emPoint;
941  }
942  else { // forward detector: use the CaloTower position
944  towerP4 = p.basicVector().unit();
945  towerP4[3] = 1.f; // energy
946  towerP4 *=E;
947 
948  // double pf=1.0/cosh(p.eta());
949  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
950  emPoint = p;
951  hadPoint = p;
952  }
953  } // end case 2
954  break;
955 
956  } // end of decision on p4 reconstruction method
957 
958 
959  // insert in collection (remove and return if below threshold)
960  if unlikely ( (towerP4[3]==0) & (E_outer>0) ) {
961  collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, CaloTower::PolarLorentzVector(0,hadPoint.eta(), hadPoint.phi(),0), emPoint, hadPoint);
962  } else {
963  collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, GlobalVector(towerP4), towerP4[3], mass2, emPoint, hadPoint);
964  }
965  auto & caloTower = collection.back();
966 
967  // if (!massless) std::cout << "massive " << id <<' ' << mass1 <<' ' << mass2 <<' ' << caloTower.mass() << std::endl;
968  // std::cout << "CaloTowerVI " <<theMomConstrMethod <<' ' << id <<' '<< E_em <<' '<< E_had <<' '<< E_outer <<' '<< GlobalVector(towerP4) <<' '<< towerP4[3] <<' '<< emPoint <<' '<< hadPoint << std::endl;
969  //if (towerP4[3]==0) std::cout << "CaloTowerVIzero " << theEcutTower << ' ' << collection.back().eta() <<' '<< collection.back().phi() << std::endl;
970 
971  if(caloTower.energy() < theEcutTower) { collection.pop_back(); return;}
972 
973  // set the timings
974  float ecalTime = (mt.emSumEForTime>0)? mt.emSumTimeTimesE/mt.emSumEForTime : -9999;
975  float hcalTime = (mt.hadSumEForTime>0)? mt.hadSumTimeTimesE/mt.hadSumEForTime : -9999;
976  caloTower.setEcalTime(compactTime(ecalTime));
977  caloTower.setHcalTime(compactTime(hcalTime));
978 
979  // set the CaloTower status word =====================================
980  // Channels must be counter exclusively in the defined cathegories
981  // "Bad" channels (not used in energy assignment) can be flagged during
982  // CaloTower creation only if specified in the configuration file
983 
984  unsigned int numBadHcalChan = mt.numBadHcalCells;
985  // unsigned int numBadEcalChan = mt.numBadEcalCells;
986  unsigned int numBadEcalChan = 0; //
987 
988  unsigned int numRecHcalChan = mt.numRecHcalCells;
989  unsigned int numRecEcalChan = mt.numRecEcalCells;
990  unsigned int numProbHcalChan = mt.numProbHcalCells;
991  unsigned int numProbEcalChan = mt.numProbEcalCells;
992 
993  // now add dead/off/... channels not used in RecHit reconstruction for HCAL
994  HcalDropChMap::iterator dropChItr = hcalDropChMap.find(id);
995  if (dropChItr != hcalDropChMap.end()) numBadHcalChan += dropChItr->second;
996 
997 
998  // for ECAL the number of all bad channels is obtained here -----------------------
999 
1000  /*
1001  // old hyper slow algorithm
1002  // get all possible constituents of the tower
1003  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
1004 
1005  for (std::vector<DetId>::iterator ac_it=allConstituents.begin();
1006  ac_it!=allConstituents.end(); ++ac_it) {
1007 
1008  if (ac_it->det()!=DetId::Ecal) continue;
1009 
1010  int thisEcalSevLvl = -999;
1011 
1012  if (ac_it->subdetId() == EcalBarrel && theEbHandle.isValid()) {
1013  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEbHandle);//, *theEcalChStatus);
1014  }
1015  else if (ac_it->subdetId() == EcalEndcap && theEeHandle.isValid()) {
1016  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEeHandle);//, *theEcalChStatus);
1017  }
1018 
1019  // check if the Ecal severity is ok to keep
1020  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1021  theEcalSeveritiesToBeExcluded.end(),
1022  thisEcalSevLvl);
1023  if (sevit!=theEcalSeveritiesToBeExcluded.end()) {
1024  ++numBadEcalChan;
1025  }
1026 
1027  }
1028 
1029  // compare with fast version
1030 
1031  // hcal:
1032  int inEcals[2] = {0,0};
1033  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i) {
1034  DetId detId = i->first;
1035  if(detId.det() == DetId::Ecal){
1036  if( detId.subdetId()==EcalBarrel ) inEcals[0] =1;
1037  else if( detId.subdetId()==EcalEndcap ) inEcals[1] =1;
1038  }
1039  }
1040 
1041  auto numBadEcalChanNew = ecalBadChs[id.denseIndex()]+mt.numBadEcalCells; // - mt.numRecEcalCells
1042  if (int(numBadEcalChanNew)!=int(numBadEcalChan)) {
1043  std::cout << "VI wrong " << ((inEcals[1]==1) ? "EE" : "" ) << id << " " << numBadEcalChanNew << " " << numBadEcalChan
1044  << " " << mt.numBadEcalCells << " " << mt.numRecEcalCells << std::endl;
1045  }
1046  */
1047 
1048  numBadEcalChan = ecalBadChs[id.denseIndex()]+mt.numBadEcalCells; // - mt.numRecEcalCells
1049 
1050  //--------------------------------------------------------------------------------------
1051 
1052  caloTower.setCaloTowerStatus(numBadHcalChan, numBadEcalChan,
1053  numRecHcalChan, numRecEcalChan,
1054  numProbHcalChan, numProbEcalChan);
1055 
1056  double maxCellE = -999.0; // for storing the hottest cell E in the calotower
1057 
1058  std::vector<DetId> contains;
1059  contains.reserve(metaContains.size());
1060  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i) {
1061 
1062  contains.push_back(i->first);
1063 
1064  if (maxCellE < i->second) {
1065  // need an extra check because of the funny towers that are empty except for the presence of an HO
1066  // hit in the constituents (JetMET wanted them saved)
1067  // This constituent is only used for storing the tower, but should not be concidered as a hot cell canditate for
1068  // configurations with useHO = false
1069 
1070 
1071  if (i->first.det()==DetId::Ecal) { // ECAL
1072  maxCellE = i->second;
1073  }
1074  else { // HCAL
1075  if (HcalDetId(i->first).subdet() != HcalOuter)
1076  maxCellE = i->second;
1077  else if (theHOIsUsed) maxCellE = i->second;
1078  }
1079 
1080  } // found higher E cell
1081 
1082  } // loop over matacontains
1083 
1084  caloTower.setConstituents(std::move(contains));
1085  caloTower.setHottestCellE(maxCellE);
1086 
1087  // std::cout << "CaloTowerVI " << nalgo << ' ' << caloTower.id() << ((inEcals[1]==1) ? "EE " : " " ) << caloTower.pt() << ' ' << caloTower.et() << ' ' << caloTower.mass() << ' '
1088  // << caloTower.constituentsSize() <<' '<< caloTower.towerStatusWord() << std::endl;
1089 
1090 }
unsigned short ecalBadChs[CaloTowerDetId::kSizeForDenseIndexing]
int i
Definition: DBlmapReader.cc:9
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
assert(m_qm.get())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Basic3DVector unit() const
GlobalPoint emShwrPos(const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double totEmE)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
#define unlikely(x)
U second(std::pair< T, U > const &p)
GlobalPoint hadShwrPos(const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double hadE)
const CaloSubdetectorGeometry * theTowerGeometry
T sqrt(T t)
Definition: SSEVec.h:48
GlobalPoint emShwrLogWeightPos(const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double totEmE)
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
T eta() const
Definition: PV3DBase.h:76
if(conf.exists("allCellsPositionCalc"))
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const_reference back() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39
std::tuple< unsigned int, bool > CaloTowersCreationAlgo::ecalChanStatusForCaloTower ( const EcalRecHit hit)

Definition at line 1601 of file CaloTowersCreationAlgo.cc.

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

Referenced by assignHitEcal().

1601  {
1602 
1603  // const DetId id = hit->detid();
1604 
1605  // uint16_t dbStatus = theEcalChStatus->find(id)->getStatusCode();
1606  // uint32_t rhFlags = hit->flags();
1607  // int severityLevel = theEcalSevLvlAlgo->severityLevel(rhFlags, dbStatus);
1608  // The methods above will become private and cannot be usef for flagging ecal spikes.
1609  // Use the recommended interface - we leave the parameters for spilke removal to be specified by ECAL.
1610 
1611 
1612  // int severityLevel = 999;
1613 
1614  EcalRecHit const & rh = *reinterpret_cast<EcalRecHit const *>(hit);
1615  int severityLevel = theEcalSevLvlAlgo->severityLevel(rh);
1616 
1617 // if (id.subdetId() == EcalBarrel) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEbHandle);//, *theEcalChStatus);
1618 // else if (id.subdetId() == EcalEndcap) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEeHandle);//, *theEcalChStatus);
1619 
1620  // there should be no other ECAL types used in this reconstruction
1621 
1622  // The definition of ECAL severity levels uses categories that
1623  // are similar to the defined for CaloTower. (However, the categorization
1624  // for CaloTowers depends on the specified maximum acceptabel severity and therefore cannnot
1625  // be exact correspondence between the two. ECAL has additional categories describing modes of failure.)
1626  // This approach is different from the initial idea and from
1627  // the implementation for HCAL. Still make the logic similar to HCAL so that one has the ability to
1628  // exclude problematic channels as defined by ECAL.
1629  // For definitions of ECAL severity levels see RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h
1630 
1631  bool isBad = (severityLevel == EcalSeverityLevel::kBad);
1632 
1633  bool isRecovered = (severityLevel == EcalSeverityLevel::kRecovered);
1634 
1635  // check if the severity is compatible with our configuration
1636  // This applies to the "default" tower cleaning
1637  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1639  severityLevel);
1640  bool accepted = (sevit==theEcalSeveritiesToBeExcluded.end()) ;
1641 
1642  // For use with hits that were rejected in the regular reconstruction:
1643  // This is for creating calotowers with lower level of cleaning by merging
1644  // the information from the default towers and a collection of towers created from
1645  // bad rechits
1646 
1647 
1648  if (useRejectedHitsOnly) {
1649 
1650  if (!isRecovered) {
1651 
1652  if (accepted ||
1655  return std::make_tuple(CaloTowersCreationAlgo::IgnoredChan,isBad);
1656  // this hit was either already accepted, or is not eligible for inclusion
1657  }
1658  else {
1659 
1661  // skip recovered hits either because they were already used or because there was an explicit instruction
1662  return std::make_tuple(CaloTowersCreationAlgo::IgnoredChan,isBad);;
1663  }
1664  else if (useRejectedRecoveredEcalHits) {
1665  return std::make_tuple(CaloTowersCreationAlgo::RecoveredChan,isBad);
1666  }
1667 
1668  } // recovered channels
1669 
1670  // clasify channels as problematic
1671  return std::make_tuple(CaloTowersCreationAlgo::ProblematicChan,isBad);
1672 
1673  } // treatment of rejected hits
1674 
1675 
1676 
1677  // for normal reconstruction
1678  if (severityLevel == EcalSeverityLevel::kGood) return std::make_tuple(CaloTowersCreationAlgo::GoodChan,false);
1679 
1680  if (isRecovered) {
1681  return std::make_tuple( (theRecoveredEcalHitsAreUsed) ?
1683  }
1684  else {
1685  return std::make_tuple(accepted ? CaloTowersCreationAlgo::ProblematicChan : CaloTowersCreationAlgo::BadChan,isBad);
1686 
1687  }
1688 
1689 
1690 }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
std::vector< int > theEcalSeveritiesToBeUsedInBadTowers
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< int > theEcalSeveritiesToBeExcluded
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
GlobalPoint CaloTowersCreationAlgo::emCrystalShwrPos ( DetId  detId,
float  fracDepth 
)

Definition at line 1233 of file CaloTowersCreationAlgo.cc.

References CaloCellGeometry::getBackPoint(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), point, and theGeometry.

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

1233  {
1234  const CaloCellGeometry* cellGeometry = theGeometry->getGeometry(detId);
1235  GlobalPoint point = cellGeometry->getPosition(); // face of the cell
1236 
1237  if (fracDepth<=0) return point;
1238  if (fracDepth>1) fracDepth=1;
1239 
1240  GlobalPoint backPoint = cellGeometry->getBackPoint();
1241  point += fracDepth * (backPoint-point);
1242 
1243  return point;
1244 }
const GlobalPoint & getBackPoint() const
const CaloGeometry * theGeometry
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
*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
GlobalPoint CaloTowersCreationAlgo::emShwrLogWeightPos ( const std::vector< std::pair< DetId, float > > &  metaContains,
float  fracDepth,
double  totEmE 
)

Definition at line 1397 of file CaloTowersCreationAlgo.cc.

References DetId::Ecal, emCrystalShwrPos(), create_public_lumi_plots::log, AlCaHLTBitMon_ParallelJobs::p, histoStyle::weight, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by convert().

1398  {
1399 
1400  double emX = 0.0;
1401  double emY = 0.0;
1402  double emZ = 0.0;
1403 
1404  double weight = 0;
1405  double sumWeights = 0;
1406  double sumEmE = 0; // add crystals with E/E_EM > 1.5%
1407  double crystalThresh = 0.015 * emE;
1408 
1409  std::vector<std::pair<DetId,float> >::const_iterator mc_it = metaContains.begin();
1410  for (; mc_it!=metaContains.end(); ++mc_it) {
1411  if (mc_it->second < 0) continue;
1412  if (mc_it->first.det() == DetId::Ecal && mc_it->second > crystalThresh) sumEmE += mc_it->second;
1413  }
1414 
1415  for (mc_it = metaContains.begin(); mc_it!=metaContains.end(); ++mc_it) {
1416 
1417  if (mc_it->first.det() != DetId::Ecal || mc_it->second < crystalThresh) continue;
1418 
1419  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1420 
1421  weight = 4.2 + log(mc_it->second/sumEmE);
1422  sumWeights += weight;
1423 
1424  emX += p.x() * weight;
1425  emY += p.y() * weight;
1426  emZ += p.z() * weight;
1427  }
1428 
1429  return GlobalPoint(emX/sumWeights, emY/sumWeights, emZ/sumWeights);
1430 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
int weight
Definition: histoStyle.py:50
T x() const
Definition: PV3DBase.h:62
GlobalPoint CaloTowersCreationAlgo::emShwrPos ( const std::vector< std::pair< DetId, float > > &  metaContains,
float  fracDepth,
double  totEmE 
)

Definition at line 1367 of file CaloTowersCreationAlgo.cc.

References alignCSCRings::e, DetId::Ecal, emCrystalShwrPos(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by convert().

1368  {
1369 
1370  if (emE<=0) return GlobalPoint(0,0,0);
1371 
1372  double emX = 0.0;
1373  double emY = 0.0;
1374  double emZ = 0.0;
1375 
1376  double eSum = 0;
1377 
1378  std::vector<std::pair<DetId,float> >::const_iterator mc_it = metaContains.begin();
1379  for (; mc_it!=metaContains.end(); ++mc_it) {
1380  if (mc_it->first.det() != DetId::Ecal) continue;
1381  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1382  double e = mc_it->second;
1383 
1384  if (e>0) {
1385  emX += p.x() * e;
1386  emY += p.y() * e;
1387  emZ += p.z() * e;
1388  eSum += e;
1389  }
1390 
1391  }
1392 
1393  return GlobalPoint(emX/eSum, emY/eSum, emZ/eSum);
1394 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62
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 772 of file CaloTowersCreationAlgo.cc.

References CaloTowerDetId::denseIndex(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::kSizeForDenseIndexing, theTowerMap, and theTowerMapSize.

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

772  {
773  if (theTowerMap.empty()) {
775  }
776 
777  auto & mt = theTowerMap[detId.denseIndex()];
778 
779  if (mt.empty()) {
780  mt.id=detId;
781  mt.metaConstituents.reserve(detId.ietaAbs()<30 ? 12 : 2);
782  ++theTowerMapSize;
783  }
784 
785  return mt;
786 }
void CaloTowersCreationAlgo::finish ( CaloTowerCollection destCollection)

Definition at line 294 of file CaloTowersCreationAlgo.cc.

References convert(), edm::SortedCollection< T, SORT >::reserve(), theTowerMap, and theTowerMapSize.

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

294  {
295  // now copy this map into the final collection
296  result.reserve(theTowerMapSize);
297  // auto k=0U;
298  // if (!theEbHandle.isValid()) std::cout << "VI ebHandle not valid" << std::endl;
299  // if (!theEeHandle.isValid()) std::cout << "VI eeHandle not valid" << std::endl;
300 
301  for(auto const & mt : theTowerMap ) {
302  // Convert only if there is at least one constituent in the metatower.
303  // The check of constituents size in the coverted tower is still needed!
304  if (!mt.empty() ) { convert(mt.id, mt, result); } // ++k;}
305  }
306 
307  // assert(k==theTowerMapSize);
308  // std::cout << "VI TowerMap " << theTowerMapSize << " " << k << std::endl;
309 
310  theTowerMap.clear(); // save the memory
311  theTowerMapSize=0;
312 }
tuple result
Definition: query.py:137
void convert(const CaloTowerDetId &id, const MetaTower &mt, CaloTowerCollection &collection)
void CaloTowersCreationAlgo::getThresholdAndWeight ( const DetId detId,
double &  threshold,
double &  weight 
) const
private

helper method to look up the appropriate threshold & weight

Definition at line 1094 of file CaloTowersCreationAlgo.cc.

References HcalDetId::depth(), DetId::det(), DetId::Ecal, EcalBarrel, EcalEndcap, HcalTopology::firstHEDoublePhiRing(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::subdet(), DetId::subdetId(), theEBEScale, theEBGrid, theEBthreshold, theEBweight, theEBWeights, theEEEScale, theEEGrid, theEEthreshold, theEEweight, theEEWeights, theHBEScale, theHBGrid, theHBthreshold, theHBweight, theHBWeights, theHcalTopology, theHEDEScale, theHEDGrid, theHEDthreshold, theHEDweight, theHEDWeights, theHESEScale, theHESGrid, theHESthreshold, theHESweight, theHESWeights, theHF1EScale, theHF1Grid, theHF1threshold, theHF1weight, theHF1Weights, theHF2EScale, theHF2Grid, theHF2threshold, theHF2weight, theHF2Weights, theHOEScale, theHOGrid, theHOthreshold0, theHOthresholdMinus1, theHOthresholdMinus2, theHOthresholdPlus1, theHOthresholdPlus2, theHOweight, and theHOWeights.

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

1094  {
1095  DetId::Detector det = detId.det();
1096  weight=0; // in case the hit is not identified
1097 
1098  if(det == DetId::Ecal) {
1099  // may or may not be EB. We'll find out.
1100 
1101  EcalSubdetector subdet = (EcalSubdetector)(detId.subdetId());
1102  if(subdet == EcalBarrel) {
1104  weight = theEBweight;
1105  if (weight <= 0.) {
1106  ROOT::Math::Interpolator my(theEBGrid,theEBWeights,ROOT::Math::Interpolation::kAKIMA);
1107  weight = my.Eval(theEBEScale);
1108  }
1109  }
1110  else if(subdet == EcalEndcap) {
1112  weight = theEEweight;
1113  if (weight <= 0.) {
1114  ROOT::Math::Interpolator my(theEEGrid,theEEWeights,ROOT::Math::Interpolation::kAKIMA);
1115  weight = my.Eval(theEEEScale);
1116  }
1117  }
1118  }
1119  else if(det == DetId::Hcal) {
1120  HcalDetId hcalDetId(detId);
1121  HcalSubdetector subdet = hcalDetId.subdet();
1122 
1123  if(subdet == HcalBarrel) {
1125  weight = theHBweight;
1126  if (weight <= 0.) {
1127  ROOT::Math::Interpolator my(theHBGrid,theHBWeights,ROOT::Math::Interpolation::kAKIMA);
1128  weight = my.Eval(theHBEScale);
1129  }
1130  }
1131 
1132  else if(subdet == HcalEndcap) {
1133  // check if it's single or double tower
1134  if(hcalDetId.ietaAbs() < theHcalTopology->firstHEDoublePhiRing()) {
1136  weight = theHESweight;
1137  if (weight <= 0.) {
1138  ROOT::Math::Interpolator my(theHESGrid,theHESWeights,ROOT::Math::Interpolation::kAKIMA);
1139  weight = my.Eval(theHESEScale);
1140  }
1141  }
1142  else {
1144  weight = theHEDweight;
1145  if (weight <= 0.) {
1146  ROOT::Math::Interpolator my(theHEDGrid,theHEDWeights,ROOT::Math::Interpolation::kAKIMA);
1147  weight = my.Eval(theHEDEScale);
1148  }
1149  }
1150  }
1151 
1152  else if(subdet == HcalOuter) {
1153  //check if it's ring 0 or +1 or +2 or -1 or -2
1154  if(hcalDetId.ietaAbs() <= 4) threshold = theHOthreshold0;
1155  else if(hcalDetId.ieta() < 0) {
1156  // set threshold for ring -1 or -2
1157  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdMinus1 : theHOthresholdMinus2;
1158  } else {
1159  // set threshold for ring +1 or +2
1160  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdPlus1 : theHOthresholdPlus2;
1161  }
1162  weight = theHOweight;
1163  if (weight <= 0.) {
1164  ROOT::Math::Interpolator my(theHOGrid,theHOWeights,ROOT::Math::Interpolation::kAKIMA);
1165  weight = my.Eval(theHOEScale);
1166  }
1167  }
1168 
1169  else if(subdet == HcalForward) {
1170  if(hcalDetId.depth() == 1) {
1172  weight = theHF1weight;
1173  if (weight <= 0.) {
1174  ROOT::Math::Interpolator my(theHF1Grid,theHF1Weights,ROOT::Math::Interpolation::kAKIMA);
1175  weight = my.Eval(theHF1EScale);
1176  }
1177  } else {
1179  weight = theHF2weight;
1180  if (weight <= 0.) {
1181  ROOT::Math::Interpolator my(theHF2Grid,theHF2Weights,ROOT::Math::Interpolation::kAKIMA);
1182  weight = my.Eval(theHF2EScale);
1183  }
1184  }
1185  }
1186  }
1187  else {
1188  edm::LogError("CaloTowersCreationAlgo") << "Bad cell: " << det << std::endl;
1189  }
1190 }
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
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< double > theHOGrid
std::vector< double > theHF1Weights
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:88
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::vector< double > theHBWeights
Detector
Definition: DetId.h:24
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
int weight
Definition: histoStyle.py:50
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
EcalSubdetector
std::vector< double > theEBWeights
GlobalPoint CaloTowersCreationAlgo::hadSegmentShwrPos ( DetId  detId,
float  fracDepth 
)

Definition at line 1246 of file CaloTowersCreationAlgo.cc.

References emCrystalShwrPos().

Referenced by hadShwrPos().

1246  {
1247  // same code as above
1248  return emCrystalShwrPos(detId, fracDepth);
1249 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
GlobalPoint CaloTowersCreationAlgo::hadShwPosFromCells ( DetId  frontCell,
DetId  backCell,
float  fracDepth 
)

Definition at line 1350 of file CaloTowersCreationAlgo.cc.

References CaloCellGeometry::getBackPoint(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), point, and theGeometry.

Referenced by hadShwrPos().

1350  {
1351 
1352  // uses the "front" and "back" cells
1353  // to determine the axis. point set by the predefined depth.
1354 
1355  const CaloCellGeometry* frontCellGeometry = theGeometry->getGeometry(DetId(frontCellId));
1356  const CaloCellGeometry* backCellGeometry = theGeometry->getGeometry(DetId(backCellId));
1357 
1358  GlobalPoint point = frontCellGeometry->getPosition();
1359  GlobalPoint backPoint = backCellGeometry->getBackPoint();
1360 
1361  point += fracDepth * (backPoint - point);
1362 
1363  return point;
1364 }
const GlobalPoint & getBackPoint() const
const CaloGeometry * theGeometry
Definition: DetId.h:18
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
*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
GlobalPoint CaloTowersCreationAlgo::hadShwrPos ( const std::vector< std::pair< DetId, float > > &  metaContains,
float  fracDepth,
double  hadE 
)

Definition at line 1252 of file CaloTowersCreationAlgo.cc.

References hadSegmentShwrPos(), DetId::Hcal, HcalOuter, AlCaHLTBitMon_ParallelJobs::p, HcalDetId::subdet(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by convert().

1253  {
1254 
1255  // this is based on available RecHits, can lead to different actual depths if
1256  // hits in multi-depth towers are not all there
1257  if (hadE<=0) return GlobalPoint(0,0,0);
1258 
1259  double hadX = 0.0;
1260  double hadY = 0.0;
1261  double hadZ = 0.0;
1262 
1263  int nConst = 0;
1264 
1265  std::vector<std::pair<DetId,float> >::const_iterator mc_it = metaContains.begin();
1266  for (; mc_it!=metaContains.end(); ++mc_it) {
1267  if (mc_it->first.det() != DetId::Hcal) continue;
1268  // do not use HO for deirection calculations for now
1269  if (HcalDetId(mc_it->first).subdet() == HcalOuter) continue;
1270  ++nConst;
1271 
1272  GlobalPoint p = hadSegmentShwrPos(mc_it->first, fracDepth);
1273 
1274  // longitudinal segmentation: do not weight by energy,
1275  // get the geometrical position
1276  hadX += p.x();
1277  hadY += p.y();
1278  hadZ += p.z();
1279  }
1280 
1281  return GlobalPoint(hadX/nConst, hadY/nConst, hadZ/nConst);
1282 }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
GlobalPoint hadSegmentShwrPos(DetId detId, float fracDepth)
T x() const
Definition: PV3DBase.h:62
GlobalPoint CaloTowersCreationAlgo::hadShwrPos ( CaloTowerDetId  id,
float  fracDepth 
)

Definition at line 1285 of file CaloTowersCreationAlgo.cc.

References hadShwPosFromCells(), HcalBarrel, HcalEndcap, HcalForward, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and point.

1285  {
1286 
1287  // set depth using geometry of cells that are associated with the
1288  // tower (regardless if they have non-zero energies)
1289 
1290 // if (hadE <= 0) return GlobalPoint(0, 0, 0);
1291 
1292  if (fracDepth < 0) fracDepth = 0;
1293  else if (fracDepth > 1) fracDepth = 1;
1294 
1295  GlobalPoint point(0,0,0);
1296 
1297  int iEta = towerId.ieta();
1298  int iPhi = towerId.iphi();
1299 
1300  HcalDetId frontCellId, backCellId;
1301 
1302  if (towerId.ietaAbs() <= 14) {
1303  // barrel, one depth only
1304  frontCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1305  backCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1306  }
1307  else if (towerId.ietaAbs() == 15) {
1308  // barrel, two depths
1309  frontCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1310  backCellId = HcalDetId(HcalBarrel, iEta, iPhi, 2);
1311  }
1312  else if (towerId.ietaAbs() == 16) {
1313  // barrel and endcap: two depths HB, one depth HE
1314  frontCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1315  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 3); // this cell is in endcap!
1316  }
1317  else if (towerId.ietaAbs() == 17) {
1318  // endcap, one depth only
1319  frontCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1320  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1321  }
1322  else if (towerId.ietaAbs() >= 18 && towerId.ietaAbs() <= 26) {
1323  // endcap: two depths
1324  frontCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1325  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 2);
1326  }
1327  else if (towerId.ietaAbs() <= 29) {
1328  // endcap: three depths
1329  frontCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1330  // there is no iEta=29 for depth 3
1331  if (iEta == 29) iEta = 28;
1332  if (iEta == -29) iEta = -28;
1333  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 3);
1334  }
1335  else if (towerId.ietaAbs() >= 30) {
1336  // forward, take the goemetry for long fibers
1337  frontCellId = HcalDetId(HcalForward, iEta, iPhi, 1);
1338  backCellId = HcalDetId(HcalForward, iEta, iPhi, 1);
1339  }
1340  else {
1341  // should not get here
1342  return point;
1343  }
1344 
1345  point = hadShwPosFromCells(DetId(frontCellId), DetId(backCellId), fracDepth);
1346 
1347  return point;
1348 }
unsigned towerId(DetId const &)
Definition: DetId.h:18
GlobalPoint hadShwPosFromCells(DetId frontCell, DetId backCell, float fracDepth)
*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
unsigned int CaloTowersCreationAlgo::hcalChanStatusForCaloTower ( const CaloRecHit hit)

Definition at line 1539 of file CaloTowersCreationAlgo.cc.

References BadChan, CaloRecHit::detid(), CaloRecHit::flags(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), GoodChan, IgnoredChan, ProblematicChan, RecoveredChan, HcalSeverityLevelComputer::recoveredRecHit(), theHcalAcceptSeverityLevel, theHcalAcceptSeverityLevelForRejectedHit, theHcalChStatus, theHcalSevLvlComputer, theRecoveredHcalHitsAreUsed, useRejectedHitsOnly, and useRejectedRecoveredHcalHits.

Referenced by assignHitHcal().

1539  {
1540 
1541  const DetId id = hit->detid();
1542 
1543  const uint32_t recHitFlag = hit->flags();
1544  const uint32_t dbStatusFlag = theHcalChStatus->getValues(id)->getValue();
1545 
1546  int severityLevel = theHcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatusFlag);
1547  bool isRecovered = theHcalSevLvlComputer->recoveredRecHit(id, recHitFlag);
1548 
1549 
1550  // For use with hits rejected in the default reconstruction
1551  if (useRejectedHitsOnly) {
1552 
1553  if (!isRecovered) {
1554 
1555  if (severityLevel <= int(theHcalAcceptSeverityLevel) ||
1557  // this hit was either already accepted or is worse than
1558  }
1559  else {
1560 
1562  // skip recovered hits either because they were already used or because there was an explicit instruction
1564  }
1565  else if (useRejectedRecoveredHcalHits) {
1567  }
1568 
1569  } // recovered channels
1570 
1571  // clasify channels as problematic: no good hits are supposed to be present in the
1572  // extra rechit collections
1574 
1575  } // treatment of rejected hits
1576 
1577 
1578 
1579 
1580  // this is for the regular reconstruction sequence
1581 
1582  if (severityLevel == 0) return CaloTowersCreationAlgo::GoodChan;
1583 
1584  if (isRecovered) {
1585  return (theRecoveredHcalHitsAreUsed) ?
1587  }
1588  else {
1589  if (severityLevel > int(theHcalAcceptSeverityLevel)) {
1591  }
1592  else {
1594  }
1595  }
1596 
1597 }
const HcalChannelQuality * theHcalChStatus
const DetId & detid() const
Definition: CaloRecHit.h:20
const Item * getValues(DetId fId, bool throwOnFail=true) const
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
uint32_t flags() const
Definition: CaloRecHit.h:21
const HcalSeverityLevelComputer * theHcalSevLvlComputer
Definition: DetId.h:18
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
uint32_t getValue() const
unsigned int theHcalAcceptSeverityLevelForRejectedHit
void CaloTowersCreationAlgo::makeEcalBadChs ( )

Definition at line 1490 of file CaloTowersCreationAlgo.cc.

References CaloTowerConstituentsMap::constituentsOf(), CaloTowerDetId::detIdFromDenseIndex(), DetId::Ecal, ecalBadChs, spr::find(), CaloTowerDetId::kSizeForDenseIndexing, EcalSeverityLevelAlgo::severityLevel(), theEcalSeveritiesToBeExcluded, theEcalSevLvlAlgo, and theTowerConstituentsMap.

Referenced by CaloTowersCreator::produce().

1490  {
1491 
1492  // std::cout << "VI making EcalBadChs ";
1493 
1494  // for ECAL the number of all bad channels is obtained here -----------------------
1495 
1496  for (auto ind=0U; ind<CaloTowerDetId::kSizeForDenseIndexing; ++ind) {
1497 
1498  auto & numBadEcalChan = ecalBadChs[ind];
1499  numBadEcalChan=0;
1500  auto id = CaloTowerDetId::detIdFromDenseIndex(ind);
1501 
1502  // this is utterly slow... (can be optmized if really needed)
1503 
1504  // get all possible constituents of the tower
1505  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
1506 
1507  for (std::vector<DetId>::iterator ac_it=allConstituents.begin();
1508  ac_it!=allConstituents.end(); ++ac_it) {
1509 
1510  if (ac_it->det()!=DetId::Ecal) continue;
1511 
1512  auto thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it);
1513 
1514  // check if the Ecal severity is ok to keep
1515  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1517  thisEcalSevLvl);
1518  if (sevit!=theEcalSeveritiesToBeExcluded.end()) {
1519  ++numBadEcalChan;
1520  }
1521  }
1522 
1523  // if (0!=numBadEcalChan) std::cout << id << ":" << numBadEcalChan << ", ";
1524  }
1525 
1526  /*
1527  int tot=0;
1528  for (auto ind=0U; ind<CaloTowerDetId::kSizeForDenseIndexing; ++ind) {
1529  if (ecalBadChs[ind]!=0) ++tot;
1530  }
1531  std::cout << " | " << tot << std::endl;
1532  */
1533 
1534 }
unsigned short ecalBadChs[CaloTowerDetId::kSizeForDenseIndexing]
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
static CaloTowerDetId detIdFromDenseIndex(uint32_t din)
const CaloTowerConstituentsMap * theTowerConstituentsMap
std::vector< int > theEcalSeveritiesToBeExcluded
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
void CaloTowersCreationAlgo::makeHcalDropChMap ( )

Definition at line 1456 of file CaloTowersCreationAlgo.cc.

References HcalDetId::depth(), HcalSeverityLevelComputer::dropChannel(), HcalCondObjectContainer< Item >::getAllChannels(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), hcalDropChMap, HcalEndcap, CaloTowerDetId::ieta(), HcalDetId::ietaAbs(), CaloTowerDetId::iphi(), HcalDetId::subdet(), theHcalChStatus, theHcalSevLvlComputer, theTowerConstituentsMap, CaloTowerConstituentsMap::towerOf(), and CaloTowerDetId::zside().

Referenced by CaloTowersCreator::produce().

1456  {
1457 
1458  // This method fills the map of number of dead channels for the calotower,
1459  // The key of the map is CaloTowerDetId.
1460  // By definition these channels are not going to be in the RecHit collections.
1461  hcalDropChMap.clear();
1462  std::vector<DetId> allChanInStatusCont = theHcalChStatus->getAllChannels();
1463 
1464  for (std::vector<DetId>::iterator it = allChanInStatusCont.begin(); it!=allChanInStatusCont.end(); ++it) {
1465 
1466  const uint32_t dbStatusFlag = theHcalChStatus->getValues(*it)->getValue();
1467 
1468  if (theHcalSevLvlComputer->dropChannel(dbStatusFlag)) {
1469 
1471 
1472  hcalDropChMap[twrId] +=1;
1473 
1474  // special case for tower 29: if HCAL hit is in depth 3 add to twr 29 as well
1475  if (HcalDetId(*it).subdet()==HcalEndcap &&
1476  HcalDetId(*it).depth()==3 &&
1477  HcalDetId(*it).ietaAbs()==28) {
1478 
1479  CaloTowerDetId twrId29(twrId.ieta()+twrId.zside(), twrId.iphi());
1480  hcalDropChMap[twrId29] +=1;
1481  }
1482 
1483  }
1484 
1485  }
1486 
1487 }
const HcalChannelQuality * theHcalChStatus
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
const Item * getValues(DetId fId, bool throwOnFail=true) const
int depth() const
get the tower depth
Definition: HcalDetId.h:55
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
std::vector< DetId > getAllChannels() const
int iphi() const
get the tower iphi
bool dropChannel(const uint32_t &mystatus) const
const CaloTowerConstituentsMap * theTowerConstituentsMap
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:49
const HcalSeverityLevelComputer * theHcalSevLvlComputer
int zside() const
get the z-side of the tower (1/-1)
int ieta() const
get the tower ieta
uint32_t getValue() const
void CaloTowersCreationAlgo::process ( const HBHERecHitCollection hbhe)
void CaloTowersCreationAlgo::process ( const HORecHitCollection ho)
void CaloTowersCreationAlgo::process ( const HFRecHitCollection hf)
void CaloTowersCreationAlgo::process ( const EcalRecHitCollection ecal)
void CaloTowersCreationAlgo::process ( const CaloTowerCollection ctc)
void CaloTowersCreationAlgo::rescale ( const CaloTower ct)
private

Definition at line 727 of file CaloTowersCreationAlgo.cc.

References CaloTower::constituent(), CaloTower::constituentsSize(), HcalDetId::depth(), DetId::det(), CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_em, CaloTowersCreationAlgo::MetaTower::E_had, CaloTowersCreationAlgo::MetaTower::E_outer, DetId::Ecal, CaloTower::ecalTime(), CaloTower::emEnergy(), CaloTowersCreationAlgo::MetaTower::emSumEForTime, CaloTowersCreationAlgo::MetaTower::emSumTimeTimesE, find(), getThresholdAndWeight(), CaloTower::hadEnergy(), CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, HcalForward, HcalOuter, CaloTower::hcalTime(), i, CaloTower::id(), CaloTowersCreationAlgo::MetaTower::metaConstituents, DetId::null(), CaloTower::outerEnergy(), HcalDetId::subdet(), theTowerConstituentsMap, dtDQMClient_cfg::threshold, CaloTowerConstituentsMap::towerOf(), and histoStyle::weight.

Referenced by process().

727  {
728  double threshold, weight;
729  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(ct->id());
730  if (towerDetId.null()) return;
731  MetaTower & tower = find(towerDetId);
732 
733  tower.E_em = 0.;
734  tower.E_had = 0.;
735  tower.E_outer = 0.;
736  for (unsigned int i=0; i<ct->constituentsSize(); i++) {
737  DetId detId = ct->constituent(i);
738  getThresholdAndWeight(detId, threshold, weight);
739  DetId::Detector det = detId.det();
740  if(det == DetId::Ecal) {
741  tower.E_em = ct->emEnergy()*weight;
742  }
743  else {
744  HcalDetId hcalDetId(detId);
745  if(hcalDetId.subdet() == HcalForward) {
746  if (hcalDetId.depth()==1) tower.E_em = ct->emEnergy()*weight;
747  if (hcalDetId.depth()==2) tower.E_had = ct->hadEnergy()*weight;
748  }
749  else if(hcalDetId.subdet() == HcalOuter) {
750  tower.E_outer = ct->outerEnergy()*weight;
751  }
752  else {
753  tower.E_had = ct->hadEnergy()*weight;
754  }
755  }
756  tower.E = tower.E_had+tower.E_em+tower.E_outer;
757 
758  // this is to be compliant with the new MetaTower setup
759  // used only for the default simple vector assignment
760  std::pair<DetId, float> mc(detId, 0);
761  tower.metaConstituents.push_back(mc);
762  }
763 
764  // preserve time inforamtion
765  tower.emSumTimeTimesE = ct->ecalTime();
766  tower.hadSumTimeTimesE = ct->hcalTime();
767  tower.emSumEForTime = 1.0;
768  tower.hadSumEForTime = 1.0;
769 }
int i
Definition: DBlmapReader.cc:9
size_t constituentsSize() const
Definition: CaloTower.h:89
DetId constituent(size_t i) const
Definition: CaloTower.h:90
float ecalTime() const
Definition: CaloTower.h:165
MetaTower & find(const CaloTowerDetId &id)
looks for a given tower in the internal cache. If it can&#39;t find it, it makes it.
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
double emEnergy() const
Definition: CaloTower.h:94
const CaloTowerConstituentsMap * theTowerConstituentsMap
double hadEnergy() const
Definition: CaloTower.h:95
Definition: DetId.h:18
CaloTowerDetId id() const
Definition: CaloTower.h:87
float hcalTime() const
Definition: CaloTower.h:166
Detector
Definition: DetId.h:24
bool null() const
is this a null id ?
Definition: DetId.h:45
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold &amp; weight
int weight
Definition: histoStyle.py:50
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
double outerEnergy() const
Definition: CaloTower.h:96
void CaloTowersCreationAlgo::rescaleTowers ( const CaloTowerCollection ctInput,
CaloTowerCollection ctResult 
)

Definition at line 315 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(), getThresholdAndWeight(), DetId::Hcal, HcalOuter, CaloTowerDetId::ietaAbs(), PV3DBase< T, PVType, FrameType >::phi(), edm::SortedCollection< T, SORT >::push_back(), CaloTower::setCaloTowerStatus(), CaloTower::setEcalTime(), CaloTower::setHcalTime(), HcalDetId::subdet(), theHF1weight, theHF2weight, theHOIsUsed, dtDQMClient_cfg::threshold, and histoStyle::weight.

Referenced by CaloTowersReCreator::produce().

315  {
316 
317  for (CaloTowerCollection::const_iterator ctcItr = ctc.begin();
318  ctcItr != ctc.end(); ++ctcItr) {
319 
320  CaloTowerDetId twrId = ctcItr->id();
321  double newE_em = ctcItr->emEnergy();
322  double newE_had = ctcItr->hadEnergy();
323  double newE_outer = ctcItr->outerEnergy();
324 
325  double threshold = 0.0; // not used: we do not change thresholds
326  double weight = 1.0;
327 
328  // HF
329  if (ctcItr->ietaAbs()>=30) {
330  double E_short = 0.5 * newE_had; // from the definitions for HF
331  double E_long = newE_em + 0.5 * newE_had; //
332  // scale
333  E_long *= theHF1weight;
334  E_short *= theHF2weight;
335  // convert
336  newE_em = E_long - E_short;
337  newE_had = 2.0 * E_short;
338  }
339 
340  else { // barrel/endcap
341 
342  // find if its in EB, or EE; determine from first ecal constituent found
343  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
344  DetId constId = ctcItr->constituent(iConst);
345  if (constId.det()!=DetId::Ecal) continue;
346  getThresholdAndWeight(constId, threshold, weight);
347  newE_em *= weight;
348  break;
349  }
350  // HO
351  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
352  DetId constId = ctcItr->constituent(iConst);
353  if (constId.det()!=DetId::Hcal) continue;
354  if (HcalDetId(constId).subdet()!=HcalOuter) continue;
355  getThresholdAndWeight(constId, threshold, weight);
356  newE_outer *= weight;
357  break;
358  }
359  // HB/HE
360  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
361  DetId constId = ctcItr->constituent(iConst);
362  if (constId.det()!=DetId::Hcal) continue;
363  if (HcalDetId(constId).subdet()==HcalOuter) continue;
364  getThresholdAndWeight(constId, threshold, weight);
365  newE_had *= weight;
366  if (ctcItr->ietaAbs()>16) newE_outer *= weight;
367  break;
368  }
369 
370  } // barrel/endcap region
371 
372  // now make the new tower
373 
374  double newE_hadTot = (theHOIsUsed && twrId.ietaAbs()<16)? newE_had+newE_outer : newE_had;
375 
376  GlobalPoint emPoint = ctcItr->emPosition();
377  GlobalPoint hadPoint = ctcItr->emPosition();
378 
379  double f_em = 1.0/cosh(emPoint.eta());
380  double f_had = 1.0/cosh(hadPoint.eta());
381 
383 
384  if (ctcItr->ietaAbs()<30) {
385  if (newE_em>0) towerP4 += CaloTower::PolarLorentzVector(newE_em*f_em, emPoint.eta(), emPoint.phi(), 0);
386  if (newE_hadTot>0) towerP4 += CaloTower::PolarLorentzVector(newE_hadTot*f_had, hadPoint.eta(), hadPoint.phi(), 0);
387  }
388  else {
389  double newE_tot = newE_em + newE_had;
390  // for HF we use common point for ecal, hcal shower positions regardless of the method
391  if (newE_tot>0) towerP4 += CaloTower::PolarLorentzVector(newE_tot*f_had, hadPoint.eta(), hadPoint.phi(), 0);
392  }
393 
394 
395 
396  CaloTower rescaledTower(twrId, newE_em, newE_had, newE_outer, -1, -1, towerP4, emPoint, hadPoint);
397  // copy the timings, have to convert back to int, 1 unit = 0.01 ns
398  rescaledTower.setEcalTime( int(ctcItr->ecalTime()*100.0 + 0.5) );
399  rescaledTower.setHcalTime( int(ctcItr->hcalTime()*100.0 + 0.5) );
400 
401  std::vector<DetId> contains;
402  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
403  contains.push_back(ctcItr->constituent(iConst));
404  }
405  rescaledTower.addConstituents(contains);
406 
407  rescaledTower.setCaloTowerStatus(ctcItr->towerStatusWord());
408 
409  ctcResult.push_back(rescaledTower);
410 
411  } // end of loop over towers
412 
413 
414 }
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:45
int ietaAbs() const
get the absolute value of the tower ieta
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< CaloTower >::const_iterator const_iterator
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
Definition: DetId.h:18
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold &amp; weight
T eta() const
Definition: PV3DBase.h:76
int weight
Definition: histoStyle.py:50
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39
void CaloTowersCreationAlgo::setEBEScale ( double  scale)

Definition at line 1192 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theEBEScale.

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

1192  {
1193  if (scale>0.00001) *&theEBEScale = scale;
1194  else *&theEBEScale = 50.;
1195 }
void CaloTowersCreationAlgo::setEbHandle ( const edm::Handle< EcalRecHitCollection eb)
inline

Definition at line 189 of file CaloTowersCreationAlgo.h.

References theEbHandle.

Referenced by CaloTowersCreator::produce().

189 { theEbHandle = eb; }
edm::Handle< EcalRecHitCollection > theEbHandle
void CaloTowersCreationAlgo::setEcalChStatusFromDB ( const EcalChannelStatus s)
inline

Definition at line 112 of file CaloTowersCreationAlgo.h.

References alignCSCRings::s, and theEcalChStatus.

Referenced by CaloTowersCreator::produce().

112 { theEcalChStatus = s; }
const EcalChannelStatus * theEcalChStatus
void CaloTowersCreationAlgo::setEcalSeveritiesToBeExcluded ( const std::vector< int > &  ecalSev)
inline

Definition at line 156 of file CaloTowersCreationAlgo.h.

References theEcalSeveritiesToBeExcluded.

Referenced by CaloTowersCreator::produce().

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

Definition at line 177 of file CaloTowersCreationAlgo.h.

References theEcalSeveritiesToBeUsedInBadTowers.

Referenced by CaloTowersCreator::produce().

std::vector< int > theEcalSeveritiesToBeUsedInBadTowers
void CaloTowersCreationAlgo::setEcalSevLvlAlgo ( const EcalSeverityLevelAlgo a)
inline

Definition at line 166 of file CaloTowersCreationAlgo.h.

References a, and theEcalSevLvlAlgo.

Referenced by CaloTowersCreator::produce().

166 { theEcalSevLvlAlgo = a; }
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
double a
Definition: hdecay.h:121
void CaloTowersCreationAlgo::setEEEScale ( double  scale)

Definition at line 1197 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theEEEScale.

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

1197  {
1198  if (scale>0.00001) *&theEEEScale = scale;
1199  else *&theEEEScale = 50.;
1200 }
void CaloTowersCreationAlgo::setEeHandle ( const edm::Handle< EcalRecHitCollection ee)
inline

Definition at line 190 of file CaloTowersCreationAlgo.h.

References theEeHandle.

Referenced by CaloTowersCreator::produce().

190 { theEeHandle = ee; }
edm::Handle< EcalRecHitCollection > theEeHandle
void CaloTowersCreationAlgo::setGeometry ( const CaloTowerConstituentsMap cttopo,
const HcalTopology htopo,
const CaloGeometry geo 
)

Definition at line 244 of file CaloTowersCreationAlgo.cc.

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

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

244  {
246  theHcalTopology = topo;
247  theGeometry = geo;
249 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
const CaloSubdetectorGeometry * theTowerGeometry
static const int SubdetId
const CaloGeometry * theGeometry
const CaloTowerConstituentsMap * theTowerConstituentsMap
const HcalTopology * theHcalTopology
void CaloTowersCreationAlgo::setHBEScale ( double  scale)

Definition at line 1202 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHBEScale.

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

1202  {
1203  if (scale>0.00001) *&theHBEScale = scale;
1204  else *&theHBEScale = 50.;
1205 }
void CaloTowersCreationAlgo::setHcalAcceptSeverityLevel ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setHcalAcceptSeverityLevelForRejectedHit ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setHcalChStatusFromDB ( const HcalChannelQuality s)
inline

Definition at line 111 of file CaloTowersCreationAlgo.h.

References alignCSCRings::s, and theHcalChStatus.

Referenced by CaloTowersCreator::produce().

111 { theHcalChStatus = s; }
const HcalChannelQuality * theHcalChStatus
void CaloTowersCreationAlgo::setHcalSevLvlComputer ( const HcalSeverityLevelComputer c)
inline

Definition at line 163 of file CaloTowersCreationAlgo.h.

References EnergyCorrector::c, and theHcalSevLvlComputer.

Referenced by CaloTowersCreator::produce().

const HcalSeverityLevelComputer * theHcalSevLvlComputer
void CaloTowersCreationAlgo::setHEDEScale ( double  scale)

Definition at line 1212 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHEDEScale.

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

1212  {
1213  if (scale>0.00001) *&theHEDEScale = scale;
1214  else *&theHEDEScale = 50.;
1215 }
void CaloTowersCreationAlgo::setHESEScale ( double  scale)

Definition at line 1207 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHESEScale.

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

1207  {
1208  if (scale>0.00001) *&theHESEScale = scale;
1209  else *&theHESEScale = 50.;
1210 }
void CaloTowersCreationAlgo::setHF1EScale ( double  scale)

Definition at line 1222 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHF1EScale.

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

1222  {
1223  if (scale>0.00001) *&theHF1EScale = scale;
1224  else *&theHF1EScale = 50.;
1225 }
void CaloTowersCreationAlgo::setHF2EScale ( double  scale)

Definition at line 1227 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHF2EScale.

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

1227  {
1228  if (scale>0.00001) *&theHF2EScale = scale;
1229  else *&theHF2EScale = 50.;
1230 }
void CaloTowersCreationAlgo::setHOEScale ( double  scale)

Definition at line 1217 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHOEScale.

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

1217  {
1218  if (scale>0.00001) *&theHOEScale = scale;
1219  else *&theHOEScale = 50.;
1220 }
void CaloTowersCreationAlgo::setRecoveredEcalHitsAreUsed ( bool  flag)
inline
void CaloTowersCreationAlgo::setRecoveredHcalHitsAreUsed ( bool  flag)
inline
void CaloTowersCreationAlgo::setUseRejectedHitsOnly ( bool  flag)
inline

Definition at line 173 of file CaloTowersCreationAlgo.h.

References useRejectedHitsOnly.

Referenced by CaloTowersCreator::produce().

void CaloTowersCreationAlgo::setUseRejectedRecoveredEcalHits ( bool  flag)
inline

Definition at line 181 of file CaloTowersCreationAlgo.h.

References useRejectedRecoveredEcalHits.

Referenced by CaloTowersCreator::produce().

void CaloTowersCreationAlgo::setUseRejectedRecoveredHcalHits ( bool  flag)
inline

Definition at line 180 of file CaloTowersCreationAlgo.h.

References useRejectedRecoveredHcalHits.

Referenced by CaloTowersCreator::produce().

Member Data Documentation

unsigned short CaloTowersCreationAlgo::ecalBadChs[CaloTowerDetId::kSizeForDenseIndexing]
private

Definition at line 337 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and makeEcalBadChs().

HcalDropChMap CaloTowersCreationAlgo::hcalDropChMap
private

Definition at line 334 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and makeHcalDropChMap().

int CaloTowersCreationAlgo::nalgo =-1

Definition at line 51 of file CaloTowersCreationAlgo.h.

double CaloTowersCreationAlgo::theEBEScale
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEBEScale().

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

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 347 of file CaloTowersCreationAlgo.h.

Referenced by setEbHandle().

double CaloTowersCreationAlgo::theEBSumThreshold
private

Definition at line 263 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEBthreshold
private

Definition at line 243 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theEBweight
private

Definition at line 261 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

const EcalChannelStatus* CaloTowersCreationAlgo::theEcalChStatus
private

Definition at line 279 of file CaloTowersCreationAlgo.h.

Referenced by setEcalChStatusFromDB().

std::vector<int> CaloTowersCreationAlgo::theEcalSeveritiesToBeExcluded
private
std::vector<int> CaloTowersCreationAlgo::theEcalSeveritiesToBeUsedInBadTowers
private
const EcalSeverityLevelAlgo* CaloTowersCreationAlgo::theEcalSevLvlAlgo
private
double CaloTowersCreationAlgo::theEcutTower
private

Definition at line 263 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEEEScale
private

Definition at line 266 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEEEScale().

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

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 348 of file CaloTowersCreationAlgo.h.

Referenced by setEeHandle().

double CaloTowersCreationAlgo::theEESumThreshold
private

Definition at line 263 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEEthreshold
private

Definition at line 243 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theEEweight
private

Definition at line 261 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

const CaloGeometry* CaloTowersCreationAlgo::theGeometry
private
double CaloTowersCreationAlgo::theHBEScale
private

Definition at line 267 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHBEScale().

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

Definition at line 255 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHBthreshold
private

Definition at line 250 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHBweight
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 255 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

unsigned int CaloTowersCreationAlgo::theHcalAcceptSeverityLevel
private
unsigned int CaloTowersCreationAlgo::theHcalAcceptSeverityLevelForRejectedHit
private
const HcalChannelQuality* CaloTowersCreationAlgo::theHcalChStatus
private
const HcalSeverityLevelComputer* CaloTowersCreationAlgo::theHcalSevLvlComputer
private
double CaloTowersCreationAlgo::theHcalThreshold
private

Definition at line 248 of file CaloTowersCreationAlgo.h.

Referenced by convert().

const HcalTopology* CaloTowersCreationAlgo::theHcalTopology
private

Definition at line 273 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setGeometry().

double CaloTowersCreationAlgo::theHEDEScale
private

Definition at line 269 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHEDEScale().

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

Definition at line 257 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHEDthreshold
private

Definition at line 250 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHEDweight
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 257 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESEScale
private

Definition at line 268 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHESEScale().

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

Definition at line 256 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESthreshold
private

Definition at line 250 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESweight
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 256 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1EScale
private

Definition at line 271 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF1EScale().

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

Definition at line 259 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1threshold
private

Definition at line 252 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1weight
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

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

Definition at line 259 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2EScale
private

Definition at line 272 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF2EScale().

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

Definition at line 260 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2threshold
private

Definition at line 252 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2weight
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

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

Definition at line 260 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOEScale
private

Definition at line 270 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHOEScale().

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

Definition at line 258 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

bool CaloTowersCreationAlgo::theHOIsUsed
private

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

Definition at line 310 of file CaloTowersCreationAlgo.h.

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

double CaloTowersCreationAlgo::theHOthreshold0
private

Definition at line 251 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdMinus1
private

Definition at line 251 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdMinus2
private

Definition at line 252 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdPlus1
private

Definition at line 251 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdPlus2
private

Definition at line 252 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOweight
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 258 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

int CaloTowersCreationAlgo::theMomConstrMethod
private

Definition at line 314 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomEBDepth
private

Definition at line 317 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomEEDepth
private

Definition at line 318 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomHBDepth
private

Definition at line 315 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomHEDepth
private

Definition at line 316 of file CaloTowersCreationAlgo.h.

Referenced by convert().

bool CaloTowersCreationAlgo::theRecoveredEcalHitsAreUsed
private
bool CaloTowersCreationAlgo::theRecoveredHcalHitsAreUsed
private
const CaloTowerConstituentsMap* CaloTowersCreationAlgo::theTowerConstituentsMap
private
const CaloSubdetectorGeometry* CaloTowersCreationAlgo::theTowerGeometry
private

Definition at line 276 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and setGeometry().

MetaTowerMap CaloTowersCreationAlgo::theTowerMap
private

Definition at line 328 of file CaloTowersCreationAlgo.h.

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

unsigned int CaloTowersCreationAlgo::theTowerMapSize =0
private

Definition at line 329 of file CaloTowersCreationAlgo.h.

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

bool CaloTowersCreationAlgo::theUseEtEBTresholdFlag
private

Definition at line 244 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::theUseEtEETresholdFlag
private

Definition at line 244 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::theUseSymEBTresholdFlag
private

Definition at line 245 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::theUseSymEETresholdFlag
private

Definition at line 245 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::useRejectedHitsOnly
private
unsigned int CaloTowersCreationAlgo::useRejectedRecoveredEcalHits
private
unsigned int CaloTowersCreationAlgo::useRejectedRecoveredHcalHits
private