test
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, int hcalPhase=0)
 
 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, int hcalPhase=0)
 
std::tuple< unsigned int, bool > ecalChanStatusForCaloTower (const EcalRecHit *hit)
 
GlobalPoint emCrystalShwrPos (DetId detId, float fracDepth)
 
GlobalPoint emShwrLogWeightPos (const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double totEmE)
 
GlobalPoint emShwrPos (const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double totEmE)
 
void finish (CaloTowerCollection &destCollection)
 
GlobalPoint hadSegmentShwrPos (DetId detId, float fracDepth)
 
GlobalPoint hadShwPosFromCells (DetId frontCell, DetId backCell, float fracDepth)
 
GlobalPoint hadShwrPos (const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double hadE)
 
GlobalPoint hadShwrPos (CaloTowerDetId id, float fracDepth)
 
unsigned int hcalChanStatusForCaloTower (const CaloRecHit *hit)
 
void makeEcalBadChs ()
 
void makeHcalDropChMap ()
 
void process (const HBHERecHitCollection &hbhe)
 
void process (const HORecHitCollection &ho)
 
void process (const HFRecHitCollection &hf)
 
void process (const EcalRecHitCollection &ecal)
 
void process (const CaloTowerCollection &ctc)
 
void rescaleTowers (const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
 
void setEBEScale (double scale)
 
void setEbHandle (const edm::Handle< EcalRecHitCollection > eb)
 
void setEcalChStatusFromDB (const EcalChannelStatus *s)
 
void setEcalSeveritiesToBeExcluded (const std::vector< int > &ecalSev)
 
void SetEcalSeveritiesToBeUsedInBadTowers (const std::vector< int > &ecalSev)
 
void setEcalSevLvlAlgo (const EcalSeverityLevelAlgo *a)
 
void setEEEScale (double scale)
 
void setEeHandle (const edm::Handle< EcalRecHitCollection > ee)
 
void setGeometry (const CaloTowerTopology *cttopo, const CaloTowerConstituentsMap *ctmap, const HcalTopology *htopo, const CaloGeometry *geo)
 
void setHBEScale (double scale)
 
void setHcalAcceptSeverityLevel (unsigned int level)
 
void setHcalAcceptSeverityLevelForRejectedHit (unsigned int level)
 
void setHcalChStatusFromDB (const HcalChannelQuality *s)
 
void setHcalSevLvlComputer (const HcalSeverityLevelComputer *c)
 
void setHEDEScale (double scale)
 
void setHESEScale (double scale)
 
void setHF1EScale (double scale)
 
void setHF2EScale (double scale)
 
void setHOEScale (double scale)
 
void 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

std::vector< unsigned short > ecalBadChs
 
HcalDropChMap hcalDropChMap
 
std::vector< int > mergedDepths
 
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
 
int theHcalPhase
 
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
 
const CaloTowerTopologytheTowerTopology
 
bool theUseEtEBTresholdFlag
 
bool theUseEtEETresholdFlag
 
bool theUseSymEBTresholdFlag
 
bool theUseSymEETresholdFlag
 
bool useRejectedHitsOnly
 
unsigned int useRejectedRecoveredEcalHits
 
unsigned int useRejectedRecoveredHcalHits
 

Detailed Description

Author
R. Wilkinson - Caltech

Definition at line 49 of file CaloTowersCreationAlgo.h.

Member Typedef Documentation

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

Definition at line 337 of file CaloTowersCreationAlgo.h.

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

Definition at line 331 of file CaloTowersCreationAlgo.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CaloTowersCreationAlgo::CaloTowersCreationAlgo ( )

Definition at line 12 of file CaloTowersCreationAlgo.cc.

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

Definition at line 74 of file CaloTowersCreationAlgo.cc.

99  : theEBthreshold(EBthreshold),
100  theEEthreshold(EEthreshold),
101 
102  theUseEtEBTresholdFlag(useEtEBTreshold),
103  theUseEtEETresholdFlag(useEtEETreshold),
104  theUseSymEBTresholdFlag(useSymEBTreshold),
105  theUseSymEETresholdFlag(useSymEETreshold),
106 
108  theHBthreshold(HBthreshold),
109  theHESthreshold(HESthreshold),
110  theHEDthreshold(HEDthreshold),
111  theHOthreshold0(HOthreshold0),
112  theHOthresholdPlus1(HOthresholdPlus1),
113  theHOthresholdMinus1(HOthresholdMinus1),
114  theHOthresholdPlus2(HOthresholdPlus2),
115  theHOthresholdMinus2(HOthresholdMinus2),
116  theHF1threshold(HF1threshold),
117  theHF2threshold(HF2threshold),
118  theEBGrid(std::vector<double>(5,10.)),
119  theEBWeights(std::vector<double>(5,1.)),
120  theEEGrid(std::vector<double>(5,10.)),
121  theEEWeights(std::vector<double>(5,1.)),
122  theHBGrid(std::vector<double>(5,10.)),
123  theHBWeights(std::vector<double>(5,1.)),
124  theHESGrid(std::vector<double>(5,10.)),
125  theHESWeights(std::vector<double>(5,1.)),
126  theHEDGrid(std::vector<double>(5,10.)),
127  theHEDWeights(std::vector<double>(5,1.)),
128  theHOGrid(std::vector<double>(5,10.)),
129  theHOWeights(std::vector<double>(5,1.)),
130  theHF1Grid(std::vector<double>(5,10.)),
131  theHF1Weights(std::vector<double>(5,1.)),
132  theHF2Grid(std::vector<double>(5,10.)),
133  theHF2Weights(std::vector<double>(5,1.)),
134  theEBweight(EBweight),
135  theEEweight(EEweight),
136  theHBweight(HBweight),
137  theHESweight(HESweight),
138  theHEDweight(HEDweight),
139  theHOweight(HOweight),
140  theHF1weight(HF1weight),
141  theHF2weight(HF2weight),
146  // (momentum reconstruction algorithm)
147  theMomConstrMethod(momConstrMethod),
148  theMomHBDepth(momHBDepth),
149  theMomHEDepth(momHEDepth),
150  theMomEBDepth(momEBDepth),
151  theMomEEDepth(momEEDepth),
152  theHcalPhase(hcalPhase)
153 {
154 }
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,
int  hcalPhase = 0 
)

Definition at line 156 of file CaloTowersCreationAlgo.cc.

188  : theEBthreshold(EBthreshold),
189  theEEthreshold(EEthreshold),
190 
191  theUseEtEBTresholdFlag(useEtEBTreshold),
192  theUseEtEETresholdFlag(useEtEETreshold),
193  theUseSymEBTresholdFlag(useSymEBTreshold),
194  theUseSymEETresholdFlag(useSymEETreshold),
195 
197  theHBthreshold(HBthreshold),
198  theHESthreshold(HESthreshold),
199  theHEDthreshold(HEDthreshold),
200  theHOthreshold0(HOthreshold0),
201  theHOthresholdPlus1(HOthresholdPlus1),
202  theHOthresholdMinus1(HOthresholdMinus1),
203  theHOthresholdPlus2(HOthresholdPlus2),
204  theHOthresholdMinus2(HOthresholdMinus2),
205  theHF1threshold(HF1threshold),
206  theHF2threshold(HF2threshold),
207  theEBGrid(EBGrid),
209  theEEGrid(EEGrid),
211  theHBGrid(HBGrid),
217  theHOGrid(HOGrid),
223  theEBweight(EBweight),
224  theEEweight(EEweight),
225  theHBweight(HBweight),
226  theHESweight(HESweight),
227  theHEDweight(HEDweight),
228  theHOweight(HOweight),
229  theHF1weight(HF1weight),
230  theHF2weight(HF2weight),
235  // (momentum reconstruction algorithm)
236  theMomConstrMethod(momConstrMethod),
237  theMomHBDepth(momHBDepth),
238  theMomHEDepth(momHEDepth),
239  theMomEBDepth(momEBDepth),
240  theMomEEDepth(momEEDepth),
241  theHcalPhase(hcalPhase)
242 
243 {
244  // static int N = 0;
245  // std::cout << "VI Algo " << ++N << std::endl;
246  // nalgo=N;
247 }
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 676 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().

676  {
677  DetId detId = recHit->detid();
678 
679  unsigned int chStatusForCT;
680  bool ecalIsBad=false;
681  std::tie(chStatusForCT,ecalIsBad) = ecalChanStatusForCaloTower(recHit);
682 
683  // this is for skipping channls: mostly needed for the creation of
684  // bad towers from hits i the bad channel collections.
685  if (chStatusForCT==CaloTowersCreationAlgo::IgnoredChan) return;
686 
687  double threshold, weight;
688  getThresholdAndWeight(detId, threshold, weight);
689 
690  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
691  double e = energy * weight; // energies scaled by user weight: used in energy assignments
692 
694 
695  // For ECAL we count all bad channels after the metatower is complete
696 
697  // Include options for symmetric thresholds and cut on Et
698  // for ECAL RecHits
699 
700  bool passEmThreshold = false;
701 
702  if (detId.subdetId() == EcalBarrel) {
703  if (theUseEtEBTresholdFlag) energy /= cosh( (theGeometry->getGeometry(detId)->getPosition()).eta() ) ;
704  if (theUseSymEBTresholdFlag) passEmThreshold = (fabs(energy) >= threshold);
705  else passEmThreshold = (energy >= threshold);
706 
707  }
708  else if (detId.subdetId() == EcalEndcap) {
709  if (theUseEtEETresholdFlag) energy /= cosh( (theGeometry->getGeometry(detId)->getPosition()).eta() ) ;
710  if (theUseSymEETresholdFlag) passEmThreshold = (fabs(energy) >= threshold);
711  else passEmThreshold = (energy >= threshold);
712  }
713 
714  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
715  if (towerDetId.null()) return;
716  MetaTower & tower = find(towerDetId);
717 
718 
719  // count bad cells and avoid double counting with those from DB (Recovered are counted bad)
720 
721  // somehow misses some
722  // if ( (chStatusForCT == CaloTowersCreationAlgo::BadChan) & (!ecalIsBad) ) ++tower.numBadEcalCells;
723 
724  // a bit slower...
725  if ( chStatusForCT == CaloTowersCreationAlgo::BadChan ) {
726  auto thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel(detId);
727  // check if the Ecal severity is ok to keep
728  auto sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
730  thisEcalSevLvl);
731  if (sevit==theEcalSeveritiesToBeExcluded.end()) ++tower.numBadEcalCells; // notinDB
732  }
733 
734 
735  // if (chStatusForCT != CaloTowersCreationAlgo::BadChan && energy >= threshold) {
736  if (chStatusForCT != CaloTowersCreationAlgo::BadChan && passEmThreshold) {
737 
738  tower.E_em += e;
739  tower.E += e;
740 
741  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
742  tower.numRecEcalCells += 1;
743  }
744  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
745  tower.numProbEcalCells += 1;
746  }
747 
748  // change when full status info is available
749  // for now use only good channels
750 
751  // add e>0 check (new options allow e<0)
752  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan && e>0 ) {
753  tower.emSumTimeTimesE += ( e * recHit->time() );
754  tower.emSumEForTime += e; // see above
755  }
756 
757  std::pair<DetId,float> mc(detId,e);
758  tower.metaConstituents.push_back(mc);
759  }
760 } // 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 457 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, spr::find(), find(), getThresholdAndWeight(), GoodChan, CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalChanStatusForCaloTower(), HcalEndcap, HcalForward, HcalOuter, CaloTowerDetId::ieta(), HcalDetId::ietaAbs(), IgnoredChan, CaloTowerDetId::iphi(), HcalTopology::lastHERing(), mergedDepths, CaloTowersCreationAlgo::MetaTower::metaConstituents, DetId::null(), CaloTowersCreationAlgo::MetaTower::numBadHcalCells, CaloTowersCreationAlgo::MetaTower::numProbHcalCells, CaloTowersCreationAlgo::MetaTower::numRecHcalCells, ProblematicChan, RecoveredChan, HcalDetId::subdet(), theHcalPhase, theHcalTopology, theHOIsUsed, theTowerConstituentsMap, dtDQMClient_cfg::threshold, CaloRecHit::time(), CaloTowerConstituentsMap::towerOf(), histoStyle::weight, and CaloTowerDetId::zside().

Referenced by process().

457  {
458  DetId detId = recHit->detid();
459 
460  unsigned int chStatusForCT = hcalChanStatusForCaloTower(recHit);
461 
462  // this is for skipping channls: mostly needed for the creation of
463  // bad towers from hits i the bad channel collections.
464  if (chStatusForCT==CaloTowersCreationAlgo::IgnoredChan) return;
465 
466  double threshold, weight;
467  getThresholdAndWeight(detId, threshold, weight);
468 
469  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
470  double e = energy * weight; // energies scaled by user weight: used in energy assignments
471 
472  // SPECIAL handling of tower 28 merged depths --> half into tower 28 and half into tower 29
473  if (detId.det()==DetId::Hcal &&
474  HcalDetId(detId).subdet()==HcalEndcap &&
475  (theHcalPhase==0 || theHcalPhase==1) &&
476  std::find(mergedDepths.begin(), mergedDepths.end(), HcalDetId(detId).depth())!=mergedDepths.end() &&
477  //HcalDetId(detId).depth()==3 &&
478  HcalDetId(detId).ietaAbs()==theHcalTopology->lastHERing()-1) {
479 
481 
482  // bad channels are counted regardless of energy threshold
483 
484  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
485  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
486  if (towerDetId.null()) return;
487  MetaTower & tower28 = find(towerDetId);
488  CaloTowerDetId towerDetId29(towerDetId.ieta()+towerDetId.zside(),
489  towerDetId.iphi());
490  MetaTower & tower29 = find(towerDetId29);
491  tower28.numBadHcalCells += 1;
492  tower29.numBadHcalCells += 1;
493  }
494 
495  else if (0.5*energy >= threshold) { // not bad channel: use energy if above threshold
496 
497  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
498  if (towerDetId.null()) return;
499  MetaTower & tower28 = find(towerDetId);
500  CaloTowerDetId towerDetId29(towerDetId.ieta()+towerDetId.zside(),
501  towerDetId.iphi());
502  MetaTower & tower29 = find(towerDetId29);
503 
504  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
505  tower28.numRecHcalCells += 1;
506  tower29.numRecHcalCells += 1;
507  }
508  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
509  tower28.numProbHcalCells += 1;
510  tower29.numProbHcalCells += 1;
511  }
512 
513  // NOTE DIVIDE BY 2!!!
514  double e28 = 0.5 * e;
515  double e29 = 0.5 * e;
516 
517  tower28.E_had += e28;
518  tower28.E += e28;
519  std::pair<DetId,float> mc(detId,e28);
520  tower28.metaConstituents.push_back(mc);
521 
522  tower29.E_had += e29;
523  tower29.E += e29;
524  tower29.metaConstituents.push_back(mc);
525 
526  // time info: do not use in averaging if timing error is found: need
527  // full set of status info to implement: use only "good" channels for now
528 
529  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
530  tower28.hadSumTimeTimesE += ( e28 * recHit->time() );
531  tower28.hadSumEForTime += e28;
532  tower29.hadSumTimeTimesE += ( e29 * recHit->time() );
533  tower29.hadSumEForTime += e29;
534  }
535 
536  // store the energy in layer 3 also in E_outer
537  tower28.E_outer += e28;
538  tower29.E_outer += e29;
539  } // not a "bad" hit
540 
541  } // end of special case
542 
543  else {
544  HcalDetId hcalDetId(detId);
545 
547 
548  if(hcalDetId.subdet() == HcalOuter) {
549 
550  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
551  if (towerDetId.null()) return;
552  MetaTower & tower = find(towerDetId);
553 
554  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
555  if (theHOIsUsed) tower.numBadHcalCells += 1;
556  }
557 
558  else if (energy >= threshold) {
559  tower.E_outer += e; // store HO energy even if HO is not used
560  // add energy of the tower and/or flag if theHOIsUsed
561  if(theHOIsUsed) {
562  tower.E += e;
563 
564  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
565  tower.numRecHcalCells += 1;
566  }
567  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
568  tower.numProbHcalCells += 1;
569  }
570  } // HO is used
571 
572 
573  // add HO to constituents even if it is not used: JetMET wants to keep these towers
574  std::pair<DetId,float> mc(detId,e);
575  tower.metaConstituents.push_back(mc);
576 
577  } // not a bad channel, energy above threshold
578 
579  } // HO hit
580 
581  // HF calculates EM fraction differently
582  else if(hcalDetId.subdet() == HcalForward) {
583 
584  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
585  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
586  if (towerDetId.null()) return;
587  MetaTower & tower = find(towerDetId);
588  tower.numBadHcalCells += 1;
589  }
590 
591  else if (energy >= threshold) {
592  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
593  if (towerDetId.null()) return;
594  MetaTower & tower = find(towerDetId);
595 
596  if (hcalDetId.depth() == 1) {
597  // long fiber, so E_EM = E(Long) - E(Short)
598  tower.E_em += e;
599  }
600  else {
601  // short fiber, EHAD = 2 * E(Short)
602  tower.E_em -= e;
603  tower.E_had += 2. * e;
604  }
605  tower.E += e;
606  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
607  tower.numRecHcalCells += 1;
608  }
609  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
610  tower.numProbHcalCells += 1;
611  }
612 
613  // put the timing in HCAL -> have to check timing errors when available
614  // for now use only good channels
615  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
616  tower.hadSumTimeTimesE += ( e * recHit->time() );
617  tower.hadSumEForTime += e;
618  }
619 
620  std::pair<DetId,float> mc(detId,e);
621  tower.metaConstituents.push_back(mc);
622 
623  } // not a bad HF channel, energy above threshold
624 
625  } // HF hit
626 
627  else {
628  // HCAL situation normal in HB/HE
629  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
630  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
631  if (towerDetId.null()) return;
632  MetaTower & tower = find(towerDetId);
633  tower.numBadHcalCells += 1;
634  }
635  else if (energy >= threshold) {
636  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
637  if (towerDetId.null()) return;
638  MetaTower & tower = find(towerDetId);
639  tower.E_had += e;
640  tower.E += e;
641  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
642  tower.numRecHcalCells += 1;
643  }
644  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
645  tower.numProbHcalCells += 1;
646  }
647 
648  // Timing information: need specific accessors
649  // for now use only good channels
650  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
651  tower.hadSumTimeTimesE += ( e * recHit->time() );
652  tower.hadSumEForTime += e;
653  }
654  // store energy in highest depth for towers 18-27 (for electron,photon ID in endcap)
655  // also, store energy in HE part of tower 16 (for JetMET cleanup)
656  HcalDetId hcalDetId(detId);
657  if (hcalDetId.subdet()==HcalEndcap && theHcalPhase==0) {
658  if ( (hcalDetId.depth()==2 && hcalDetId.ietaAbs()>=18 && hcalDetId.ietaAbs()<27) ||
659  (hcalDetId.depth()==3 && hcalDetId.ietaAbs()==27) ||
660  (hcalDetId.depth()==3 && hcalDetId.ietaAbs()==16) ) {
661  tower.E_outer += e;
662  }
663  }
664 
665  std::pair<DetId,float> mc(detId,e);
666  tower.metaConstituents.push_back(mc);
667 
668  } // not a "bad" channel, energy above threshold
669 
670  } // channel in HBHE (excluding twrs 28,29)
671 
672  } // recHit normal case (not in HE towers 28,29)
673 
674 } // end of assignHitHcal method
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
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
std::vector< int > mergedDepths
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.cc:96
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
const HcalTopology * theHcalTopology
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
int lastHERing() const
Definition: HcalTopology.h:86
void CaloTowersCreationAlgo::begin ( void  )

Definition at line 286 of file CaloTowersCreationAlgo.cc.

References theTowerMap, and theTowerMapSize.

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

286  {
287  theTowerMap.clear();
288  theTowerMapSize=0;
289  //hcalDropChMap.clear();
290 }
int CaloTowersCreationAlgo::compactTime ( float  time)
private

Definition at line 1474 of file CaloTowersCreationAlgo.cc.

Referenced by convert().

1474  {
1475 
1476  const float timeUnit = 0.01; // discretization (ns)
1477 
1478  if (time> 300.0) return 30000;
1479  if (time< -300.0) return -30000;
1480 
1481  return int(time/timeUnit + 0.5);
1482 
1483 }
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 831 of file CaloTowersCreationAlgo.cc.

References assert(), edm::SortedCollection< T, SORT >::back(), PV3DBase< T, PVType, FrameType >::basicVector(), compactTime(), edm::contains(), CaloTowerTopology::denseIndex(), mps_update::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(), CaloTowerTopology::firstHFRing(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), hadShwrPos(), CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalDropChMap, HcalOuter, i, reco::if(), CaloTowerTopology::lastHBRing(), CaloTowerTopology::lastHERing(), CaloTowerTopology::lastHFRing(), CaloTowerTopology::lastHORing(), CaloTowersCreationAlgo::MetaTower::metaConstituents, eostools::move(), 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, theTowerTopology, Basic3DVector< T >::unit(), and unlikely.

Referenced by finish().

833 {
834  assert(id.rawId()!=0);
835 
836  double ecalThres=(id.ietaAbs()<=17)?(theEBSumThreshold):(theEESumThreshold);
837  double E=mt.E;
838  double E_em=mt.E_em;
839  double E_had=mt.E_had;
840  double E_outer=mt.E_outer;
841 
842  // Note: E_outer is used to save HO energy OR energy in the outermost depths in endcap region
843  // In the methods with separate treatment of EM and HAD components:
844  // - HO is not used to determine direction, however HO energy is added to get "total had energy"
845  // => Check if the tower is within HO coverage before adding E_outer to the "total had" energy
846  // else the energy will be double counted
847  // When summing up the energy of the tower these checks are performed in the loops over RecHits
848 
849  std::vector<std::pair<DetId,float> > metaContains=mt.metaConstituents;
850  if (id.ietaAbs()<theTowerTopology->firstHFRing() && E_em<ecalThres) { // ignore EM threshold in HF
851  E-=E_em;
852  E_em=0;
853  std::vector<std::pair<DetId,float> > metaContains_noecal;
854 
855  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i)
856  if (i->first.det()!=DetId::Ecal) metaContains_noecal.push_back(*i);
857  metaContains.swap(metaContains_noecal);
858  }
859  if (id.ietaAbs()<theTowerTopology->firstHFRing() && E_had<theHcalThreshold) {
860  E-=E_had;
861 
862  if (theHOIsUsed && id.ietaAbs()<=theTowerTopology->lastHORing()) E-=E_outer; // not subtracted before, think it should be done
863 
864  E_had=0;
865  E_outer=0;
866  std::vector<std::pair<DetId,float> > metaContains_nohcal;
867 
868  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i)
869  if (i->first.det()!=DetId::Hcal) metaContains_nohcal.push_back(*i);
870  metaContains.swap(metaContains_nohcal);
871  }
872 
873  if(metaContains.empty()) return;
874 
875  double E_had_tot = (theHOIsUsed && id.ietaAbs()<=theTowerTopology->lastHORing())? E_had+E_outer : E_had;
876 
877 
878  // create CaloTower using the selected algorithm
879 
880  GlobalPoint emPoint, hadPoint;
881 
882  // this is actually a 4D vector
883  Basic3DVectorF towerP4;
884  bool massless=true;
885  // float mass1=0;
886  float mass2=0;
887 
888  // conditional assignment of depths for barrel/endcap
889  // Some additional tuning may be required in the transitional region
890  // 14<|iEta|<19
891  double momEmDepth = 0.;
892  double momHadDepth = 0.;
893  if (id.ietaAbs()<=17) {
894  momHadDepth = theMomHBDepth;
895  momEmDepth = theMomEBDepth;
896  }
897  else {
898  momHadDepth = theMomHEDepth;
899  momEmDepth = theMomEEDepth;
900  }
901 
902 
903 
904  switch (theMomConstrMethod) {
905 
906  // FIXME : move to simple cartesian algebra
907  case 0 :
908  { // Simple 4-momentum assignment
910  towerP4 = p.basicVector().unit();
911  towerP4[3] = 1.f; // energy
912  towerP4 *=E;
913 
914  // double pf=1.0/cosh(p.eta());
915  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0);
916 
917  emPoint = p;
918  hadPoint = p;
919  } // end case 0
920  break;
921 
922  case 1 :
923  { // separate 4-vectors for ECAL, HCAL, add to get the 4-vector of the tower (=>tower has mass!)
924  if (id.ietaAbs()<theTowerTopology->firstHFRing()) {
925  Basic3DVectorF emP4;
926  if (E_em>0) {
927  emPoint = emShwrPos(metaContains, momEmDepth, E_em);
928  emP4 = emPoint.basicVector().unit();
929  emP4[3] = 1.f; // energy
930  towerP4 = emP4*E_em;
931 
932  // double emPf = 1.0/cosh(emPoint.eta());
933  // towerP4 += CaloTower::PolarLorentzVector(E_em*emPf, emPoint.eta(), emPoint.phi(), 0);
934  }
935  if ( (E_had + E_outer) >0) {
936  massless = (E_em<=0);
937  hadPoint = hadShwrPos(id, momHadDepth);
938  auto lP4 = hadPoint.basicVector().unit();
939  lP4[3] = 1.f; // energy
940  if (!massless) {
941  auto diff = lP4-emP4; mass2 = std::sqrt(E_em*E_had_tot*diff.mag2());
942  }
943  lP4 *=E_had_tot;
944  towerP4 +=lP4;
945  /*
946  if (!massless) {
947  auto p = towerP4;
948  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;
949  }
950  */
951  // double hadPf = 1.0/cosh(hadPoint.eta());
952  // if (E_had_tot>0) {
953  // towerP4 += CaloTower::PolarLorentzVector(E_had_tot*hadPf, hadPoint.eta(), hadPoint.phi(), 0);
954  // }
955  }
956  }
957  else { // forward detector: use the CaloTower position
959  towerP4 = p.basicVector().unit();
960  towerP4[3] = 1.f; // energy
961  towerP4 *=E;
962  // double pf=1.0/cosh(p.eta());
963  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
964  emPoint = p;
965  hadPoint = p;
966  }
967  } // end case 1
968  break;
969 
970  case 2:
971  { // use ECAL position for the tower (when E_cal>0), else default CaloTower position (massless tower)
972  if (id.ietaAbs()<theTowerTopology->firstHFRing()) {
973  if (E_em>0) emPoint = emShwrLogWeightPos(metaContains, momEmDepth, E_em);
974  else emPoint = theTowerGeometry->getGeometry(id)->getPosition();
975  towerP4 = emPoint.basicVector().unit();
976  towerP4[3] = 1.f; // energy
977  towerP4 *=E;
978 
979  // double sumPf = 1.0/cosh(emPoint.eta());
981 
982  hadPoint = emPoint;
983  }
984  else { // forward detector: use the CaloTower position
986  towerP4 = p.basicVector().unit();
987  towerP4[3] = 1.f; // energy
988  towerP4 *=E;
989 
990  // double pf=1.0/cosh(p.eta());
991  // if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
992  emPoint = p;
993  hadPoint = p;
994  }
995  } // end case 2
996  break;
997 
998  } // end of decision on p4 reconstruction method
999 
1000 
1001  // insert in collection (remove and return if below threshold)
1002  if unlikely ( (towerP4[3]==0) & (E_outer>0) ) {
1003  float val = theHOIsUsed ? 0 : 1E-9; // to keep backwards compatibility for theHOIsUsed == true
1004  collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, CaloTower::PolarLorentzVector(val,hadPoint.eta(), hadPoint.phi(),0), emPoint, hadPoint);
1005  } else {
1006  collection.emplace_back(id, E_em, E_had, E_outer, -1, -1, GlobalVector(towerP4), towerP4[3], mass2, emPoint, hadPoint);
1007  }
1008  auto & caloTower = collection.back();
1009 
1010  // if (!massless) std::cout << "massive " << id <<' ' << mass1 <<' ' << mass2 <<' ' << caloTower.mass() << std::endl;
1011  // std::cout << "CaloTowerVI " <<theMomConstrMethod <<' ' << id <<' '<< E_em <<' '<< E_had <<' '<< E_outer <<' '<< GlobalVector(towerP4) <<' '<< towerP4[3] <<' '<< emPoint <<' '<< hadPoint << std::endl;
1012  //if (towerP4[3]==0) std::cout << "CaloTowerVIzero " << theEcutTower << ' ' << collection.back().eta() <<' '<< collection.back().phi() << std::endl;
1013 
1014  if(caloTower.energy() < theEcutTower) { collection.pop_back(); return;}
1015 
1016  // set the timings
1017  float ecalTime = (mt.emSumEForTime>0)? mt.emSumTimeTimesE/mt.emSumEForTime : -9999;
1018  float hcalTime = (mt.hadSumEForTime>0)? mt.hadSumTimeTimesE/mt.hadSumEForTime : -9999;
1019  caloTower.setEcalTime(compactTime(ecalTime));
1020  caloTower.setHcalTime(compactTime(hcalTime));
1021  //add topology info
1022  caloTower.setHcalSubdet(theTowerTopology->lastHBRing(),
1026 
1027  // set the CaloTower status word =====================================
1028  // Channels must be counter exclusively in the defined cathegories
1029  // "Bad" channels (not used in energy assignment) can be flagged during
1030  // CaloTower creation only if specified in the configuration file
1031 
1032  unsigned int numBadHcalChan = mt.numBadHcalCells;
1033  // unsigned int numBadEcalChan = mt.numBadEcalCells;
1034  unsigned int numBadEcalChan = 0; //
1035 
1036  unsigned int numRecHcalChan = mt.numRecHcalCells;
1037  unsigned int numRecEcalChan = mt.numRecEcalCells;
1038  unsigned int numProbHcalChan = mt.numProbHcalCells;
1039  unsigned int numProbEcalChan = mt.numProbEcalCells;
1040 
1041  // now add dead/off/... channels not used in RecHit reconstruction for HCAL
1042  HcalDropChMap::iterator dropChItr = hcalDropChMap.find(id);
1043  if (dropChItr != hcalDropChMap.end()) numBadHcalChan += dropChItr->second;
1044 
1045 
1046  // for ECAL the number of all bad channels is obtained here -----------------------
1047 
1048  /*
1049  // old hyper slow algorithm
1050  // get all possible constituents of the tower
1051  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
1052 
1053  for (std::vector<DetId>::iterator ac_it=allConstituents.begin();
1054  ac_it!=allConstituents.end(); ++ac_it) {
1055 
1056  if (ac_it->det()!=DetId::Ecal) continue;
1057 
1058  int thisEcalSevLvl = -999;
1059 
1060  if (ac_it->subdetId() == EcalBarrel && theEbHandle.isValid()) {
1061  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEbHandle);//, *theEcalChStatus);
1062  }
1063  else if (ac_it->subdetId() == EcalEndcap && theEeHandle.isValid()) {
1064  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEeHandle);//, *theEcalChStatus);
1065  }
1066 
1067  // check if the Ecal severity is ok to keep
1068  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1069  theEcalSeveritiesToBeExcluded.end(),
1070  thisEcalSevLvl);
1071  if (sevit!=theEcalSeveritiesToBeExcluded.end()) {
1072  ++numBadEcalChan;
1073  }
1074 
1075  }
1076 
1077  // compare with fast version
1078 
1079  // hcal:
1080  int inEcals[2] = {0,0};
1081  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i) {
1082  DetId detId = i->first;
1083  if(detId.det() == DetId::Ecal){
1084  if( detId.subdetId()==EcalBarrel ) inEcals[0] =1;
1085  else if( detId.subdetId()==EcalEndcap ) inEcals[1] =1;
1086  }
1087  }
1088 
1089  auto numBadEcalChanNew = ecalBadChs[theTowerTopology->denseIndex(id)]+mt.numBadEcalCells; // - mt.numRecEcalCells
1090  if (int(numBadEcalChanNew)!=int(numBadEcalChan)) {
1091  std::cout << "VI wrong " << ((inEcals[1]==1) ? "EE" : "" ) << id << " " << numBadEcalChanNew << " " << numBadEcalChan
1092  << " " << mt.numBadEcalCells << " " << mt.numRecEcalCells << std::endl;
1093  }
1094  */
1095 
1096  numBadEcalChan = ecalBadChs[theTowerTopology->denseIndex(id)]+mt.numBadEcalCells; // - mt.numRecEcalCells
1097 
1098  //--------------------------------------------------------------------------------------
1099 
1100  caloTower.setCaloTowerStatus(numBadHcalChan, numBadEcalChan,
1101  numRecHcalChan, numRecEcalChan,
1102  numProbHcalChan, numProbEcalChan);
1103 
1104  double maxCellE = -999.0; // for storing the hottest cell E in the calotower
1105 
1106  std::vector<DetId> contains;
1107  contains.reserve(metaContains.size());
1108  for (std::vector<std::pair<DetId,float> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i) {
1109 
1110  contains.push_back(i->first);
1111 
1112  if (maxCellE < i->second) {
1113  // need an extra check because of the funny towers that are empty except for the presence of an HO
1114  // hit in the constituents (JetMET wanted them saved)
1115  // This constituent is only used for storing the tower, but should not be concidered as a hot cell canditate for
1116  // configurations with useHO = false
1117 
1118 
1119  if (i->first.det()==DetId::Ecal) { // ECAL
1120  maxCellE = i->second;
1121  }
1122  else { // HCAL
1123  if (HcalDetId(i->first).subdet() != HcalOuter)
1124  maxCellE = i->second;
1125  else if (theHOIsUsed) maxCellE = i->second;
1126  }
1127 
1128  } // found higher E cell
1129 
1130  } // loop over matacontains
1131 
1132  caloTower.setConstituents(std::move(contains));
1133  caloTower.setHottestCellE(maxCellE);
1134 
1135  // std::cout << "CaloTowerVI " << nalgo << ' ' << caloTower.id() << ((inEcals[1]==1) ? "EE " : " " ) << caloTower.pt() << ' ' << caloTower.et() << ' ' << caloTower.mass() << ' '
1136  // << caloTower.constituentsSize() <<' '<< caloTower.towerStatusWord() << std::endl;
1137 
1138 }
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:49
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)
list diff
Definition: mps_update.py:85
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
int lastHFRing() const
T sqrt(T t)
Definition: SSEVec.h:18
def move
Definition: eostools.py:510
GlobalPoint emShwrLogWeightPos(const std::vector< std::pair< DetId, float > > &metaContains, float fracDepth, double totEmE)
const CaloTowerTopology * theTowerTopology
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
uint32_t denseIndex(const DetId &id) const
T eta() const
Definition: PV3DBase.h:76
std::vector< unsigned short > ecalBadChs
int lastHERing() const
if(dp >Float(M_PI)) dp-
int lastHORing() const
int lastHBRing() const
int firstHFRing() const
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 1642 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().

1642  {
1643 
1644  // const DetId id = hit->detid();
1645 
1646  // uint16_t dbStatus = theEcalChStatus->find(id)->getStatusCode();
1647  // uint32_t rhFlags = hit->flags();
1648  // int severityLevel = theEcalSevLvlAlgo->severityLevel(rhFlags, dbStatus);
1649  // The methods above will become private and cannot be usef for flagging ecal spikes.
1650  // Use the recommended interface - we leave the parameters for spilke removal to be specified by ECAL.
1651 
1652 
1653  // int severityLevel = 999;
1654 
1655  EcalRecHit const & rh = *reinterpret_cast<EcalRecHit const *>(hit);
1656  int severityLevel = theEcalSevLvlAlgo->severityLevel(rh);
1657 
1658 // if (id.subdetId() == EcalBarrel) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEbHandle);//, *theEcalChStatus);
1659 // else if (id.subdetId() == EcalEndcap) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEeHandle);//, *theEcalChStatus);
1660 
1661  // there should be no other ECAL types used in this reconstruction
1662 
1663  // The definition of ECAL severity levels uses categories that
1664  // are similar to the defined for CaloTower. (However, the categorization
1665  // for CaloTowers depends on the specified maximum acceptabel severity and therefore cannnot
1666  // be exact correspondence between the two. ECAL has additional categories describing modes of failure.)
1667  // This approach is different from the initial idea and from
1668  // the implementation for HCAL. Still make the logic similar to HCAL so that one has the ability to
1669  // exclude problematic channels as defined by ECAL.
1670  // For definitions of ECAL severity levels see RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h
1671 
1672  bool isBad = (severityLevel == EcalSeverityLevel::kBad);
1673 
1674  bool isRecovered = (severityLevel == EcalSeverityLevel::kRecovered);
1675 
1676  // check if the severity is compatible with our configuration
1677  // This applies to the "default" tower cleaning
1678  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1680  severityLevel);
1681  bool accepted = (sevit==theEcalSeveritiesToBeExcluded.end()) ;
1682 
1683  // For use with hits that were rejected in the regular reconstruction:
1684  // This is for creating calotowers with lower level of cleaning by merging
1685  // the information from the default towers and a collection of towers created from
1686  // bad rechits
1687 
1688 
1689  if (useRejectedHitsOnly) {
1690 
1691  if (!isRecovered) {
1692 
1693  if (accepted ||
1696  return std::make_tuple(CaloTowersCreationAlgo::IgnoredChan,isBad);
1697  // this hit was either already accepted, or is not eligible for inclusion
1698  }
1699  else {
1700 
1702  // skip recovered hits either because they were already used or because there was an explicit instruction
1703  return std::make_tuple(CaloTowersCreationAlgo::IgnoredChan,isBad);;
1704  }
1705  else if (useRejectedRecoveredEcalHits) {
1706  return std::make_tuple(CaloTowersCreationAlgo::RecoveredChan,isBad);
1707  }
1708 
1709  } // recovered channels
1710 
1711  // clasify channels as problematic
1712  return std::make_tuple(CaloTowersCreationAlgo::ProblematicChan,isBad);
1713 
1714  } // treatment of rejected hits
1715 
1716 
1717 
1718  // for normal reconstruction
1719  if (severityLevel == EcalSeverityLevel::kGood) return std::make_tuple(CaloTowersCreationAlgo::GoodChan,false);
1720 
1721  if (isRecovered) {
1722  return std::make_tuple( (theRecoveredEcalHitsAreUsed) ?
1724  }
1725  else {
1726  return std::make_tuple(accepted ? CaloTowersCreationAlgo::ProblematicChan : CaloTowersCreationAlgo::BadChan,isBad);
1727 
1728  }
1729 
1730 
1731 }
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 1281 of file CaloTowersCreationAlgo.cc.

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

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

1281  {
1282  const CaloCellGeometry* cellGeometry = theGeometry->getGeometry(detId);
1283  GlobalPoint point = cellGeometry->getPosition(); // face of the cell
1284 
1285  if (fracDepth<=0) return point;
1286  if (fracDepth>1) fracDepth=1;
1287 
1288  GlobalPoint backPoint = cellGeometry->getBackPoint();
1289  point += fracDepth * (backPoint-point);
1290 
1291  return point;
1292 }
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 1435 of file CaloTowersCreationAlgo.cc.

References DetId::Ecal, emCrystalShwrPos(), dqm-mbProfile::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().

1436  {
1437 
1438  double emX = 0.0;
1439  double emY = 0.0;
1440  double emZ = 0.0;
1441 
1442  double weight = 0;
1443  double sumWeights = 0;
1444  double sumEmE = 0; // add crystals with E/E_EM > 1.5%
1445  double crystalThresh = 0.015 * emE;
1446 
1447  std::vector<std::pair<DetId,float> >::const_iterator mc_it = metaContains.begin();
1448  for (; mc_it!=metaContains.end(); ++mc_it) {
1449  if (mc_it->second < 0) continue;
1450  if (mc_it->first.det() == DetId::Ecal && mc_it->second > crystalThresh) sumEmE += mc_it->second;
1451  }
1452 
1453  for (mc_it = metaContains.begin(); mc_it!=metaContains.end(); ++mc_it) {
1454 
1455  if (mc_it->first.det() != DetId::Ecal || mc_it->second < crystalThresh) continue;
1456 
1457  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1458 
1459  weight = 4.2 + log(mc_it->second/sumEmE);
1460  sumWeights += weight;
1461 
1462  emX += p.x() * weight;
1463  emY += p.y() * weight;
1464  emZ += p.z() * weight;
1465  }
1466 
1467  return GlobalPoint(emX/sumWeights, emY/sumWeights, emZ/sumWeights);
1468 }
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 1405 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().

1406  {
1407 
1408  if (emE<=0) return GlobalPoint(0,0,0);
1409 
1410  double emX = 0.0;
1411  double emY = 0.0;
1412  double emZ = 0.0;
1413 
1414  double eSum = 0;
1415 
1416  std::vector<std::pair<DetId,float> >::const_iterator mc_it = metaContains.begin();
1417  for (; mc_it!=metaContains.end(); ++mc_it) {
1418  if (mc_it->first.det() != DetId::Ecal) continue;
1419  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1420  double e = mc_it->second;
1421 
1422  if (e>0) {
1423  emX += p.x() * e;
1424  emY += p.y() * e;
1425  emZ += p.z() * e;
1426  eSum += e;
1427  }
1428 
1429  }
1430 
1431  return GlobalPoint(emX/eSum, emY/eSum, emZ/eSum);
1432 }
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 814 of file CaloTowersCreationAlgo.cc.

References CaloTowerTopology::denseIndex(), CaloTowerTopology::firstHFRing(), CaloTowerDetId::ietaAbs(), CaloTowerTopology::sizeForDenseIndexing(), theTowerMap, theTowerMapSize, and theTowerTopology.

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

814  {
815  if (theTowerMap.empty()) {
817  }
818 
819  auto & mt = theTowerMap[theTowerTopology->denseIndex(detId)];
820 
821  if (mt.empty()) {
822  mt.id=detId;
823  mt.metaConstituents.reserve(detId.ietaAbs()<theTowerTopology->firstHFRing() ? 12 : 2);
824  ++theTowerMapSize;
825  }
826 
827  return mt;
828 }
const CaloTowerTopology * theTowerTopology
uint32_t denseIndex(const DetId &id) const
int firstHFRing() const
uint32_t sizeForDenseIndexing() const
void CaloTowersCreationAlgo::finish ( CaloTowerCollection destCollection)

Definition at line 329 of file CaloTowersCreationAlgo.cc.

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

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

329  {
330  // now copy this map into the final collection
331  result.reserve(theTowerMapSize);
332  // auto k=0U;
333  // if (!theEbHandle.isValid()) std::cout << "VI ebHandle not valid" << std::endl;
334  // if (!theEeHandle.isValid()) std::cout << "VI eeHandle not valid" << std::endl;
335 
336  for(auto const & mt : theTowerMap ) {
337  // Convert only if there is at least one constituent in the metatower.
338  // The check of constituents size in the coverted tower is still needed!
339  if (!mt.empty() ) { convert(mt.id, mt, result); } // ++k;}
340  }
341 
342  // assert(k==theTowerMapSize);
343  // std::cout << "VI TowerMap " << theTowerMapSize << " " << k << std::endl;
344 
345  theTowerMap.clear(); // save the memory
346  theTowerMapSize=0;
347 }
tuple result
Definition: mps_fire.py:84
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 1142 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().

1142  {
1143  DetId::Detector det = detId.det();
1144  weight=0; // in case the hit is not identified
1145 
1146  if(det == DetId::Ecal) {
1147  // may or may not be EB. We'll find out.
1148 
1149  EcalSubdetector subdet = (EcalSubdetector)(detId.subdetId());
1150  if(subdet == EcalBarrel) {
1152  weight = theEBweight;
1153  if (weight <= 0.) {
1154  ROOT::Math::Interpolator my(theEBGrid,theEBWeights,ROOT::Math::Interpolation::kAKIMA);
1155  weight = my.Eval(theEBEScale);
1156  }
1157  }
1158  else if(subdet == EcalEndcap) {
1160  weight = theEEweight;
1161  if (weight <= 0.) {
1162  ROOT::Math::Interpolator my(theEEGrid,theEEWeights,ROOT::Math::Interpolation::kAKIMA);
1163  weight = my.Eval(theEEEScale);
1164  }
1165  }
1166  }
1167  else if(det == DetId::Hcal) {
1168  HcalDetId hcalDetId(detId);
1169  HcalSubdetector subdet = hcalDetId.subdet();
1170 
1171  if(subdet == HcalBarrel) {
1173  weight = theHBweight;
1174  if (weight <= 0.) {
1175  ROOT::Math::Interpolator my(theHBGrid,theHBWeights,ROOT::Math::Interpolation::kAKIMA);
1176  weight = my.Eval(theHBEScale);
1177  }
1178  }
1179 
1180  else if(subdet == HcalEndcap) {
1181  // check if it's single or double tower
1182  if(hcalDetId.ietaAbs() < theHcalTopology->firstHEDoublePhiRing()) {
1184  weight = theHESweight;
1185  if (weight <= 0.) {
1186  ROOT::Math::Interpolator my(theHESGrid,theHESWeights,ROOT::Math::Interpolation::kAKIMA);
1187  weight = my.Eval(theHESEScale);
1188  }
1189  }
1190  else {
1192  weight = theHEDweight;
1193  if (weight <= 0.) {
1194  ROOT::Math::Interpolator my(theHEDGrid,theHEDWeights,ROOT::Math::Interpolation::kAKIMA);
1195  weight = my.Eval(theHEDEScale);
1196  }
1197  }
1198  }
1199 
1200  else if(subdet == HcalOuter) {
1201  //check if it's ring 0 or +1 or +2 or -1 or -2
1202  if(hcalDetId.ietaAbs() <= 4) threshold = theHOthreshold0;
1203  else if(hcalDetId.ieta() < 0) {
1204  // set threshold for ring -1 or -2
1205  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdMinus1 : theHOthresholdMinus2;
1206  } else {
1207  // set threshold for ring +1 or +2
1208  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdPlus1 : theHOthresholdPlus2;
1209  }
1210  weight = theHOweight;
1211  if (weight <= 0.) {
1212  ROOT::Math::Interpolator my(theHOGrid,theHOWeights,ROOT::Math::Interpolation::kAKIMA);
1213  weight = my.Eval(theHOEScale);
1214  }
1215  }
1216 
1217  else if(subdet == HcalForward) {
1218  if(hcalDetId.depth() == 1) {
1220  weight = theHF1weight;
1221  if (weight <= 0.) {
1222  ROOT::Math::Interpolator my(theHF1Grid,theHF1Weights,ROOT::Math::Interpolation::kAKIMA);
1223  weight = my.Eval(theHF1EScale);
1224  }
1225  } else {
1227  weight = theHF2weight;
1228  if (weight <= 0.) {
1229  ROOT::Math::Interpolator my(theHF2Grid,theHF2Weights,ROOT::Math::Interpolation::kAKIMA);
1230  weight = my.Eval(theHF2EScale);
1231  }
1232  }
1233  }
1234  }
1235  else {
1236  edm::LogError("CaloTowersCreationAlgo") << "Bad cell: " << det << std::endl;
1237  }
1238 }
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:92
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 1294 of file CaloTowersCreationAlgo.cc.

References emCrystalShwrPos().

Referenced by hadShwrPos().

1294  {
1295  // same code as above
1296  return emCrystalShwrPos(detId, fracDepth);
1297 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
GlobalPoint CaloTowersCreationAlgo::hadShwPosFromCells ( DetId  frontCell,
DetId  backCell,
float  fracDepth 
)

Definition at line 1388 of file CaloTowersCreationAlgo.cc.

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

Referenced by hadShwrPos().

1388  {
1389 
1390  // uses the "front" and "back" cells
1391  // to determine the axis. point set by the predefined depth.
1392 
1393  const CaloCellGeometry* frontCellGeometry = theGeometry->getGeometry(DetId(frontCellId));
1394  const CaloCellGeometry* backCellGeometry = theGeometry->getGeometry(DetId(backCellId));
1395 
1396  GlobalPoint point = frontCellGeometry->getPosition();
1397  GlobalPoint backPoint = backCellGeometry->getBackPoint();
1398 
1399  point += fracDepth * (backPoint - point);
1400 
1401  return point;
1402 }
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 1300 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().

1301  {
1302 
1303  // this is based on available RecHits, can lead to different actual depths if
1304  // hits in multi-depth towers are not all there
1305  if (hadE<=0) return GlobalPoint(0,0,0);
1306 
1307  double hadX = 0.0;
1308  double hadY = 0.0;
1309  double hadZ = 0.0;
1310 
1311  int nConst = 0;
1312 
1313  std::vector<std::pair<DetId,float> >::const_iterator mc_it = metaContains.begin();
1314  for (; mc_it!=metaContains.end(); ++mc_it) {
1315  if (mc_it->first.det() != DetId::Hcal) continue;
1316  // do not use HO for deirection calculations for now
1317  if (HcalDetId(mc_it->first).subdet() == HcalOuter) continue;
1318  ++nConst;
1319 
1320  GlobalPoint p = hadSegmentShwrPos(mc_it->first, fracDepth);
1321 
1322  // longitudinal segmentation: do not weight by energy,
1323  // get the geometrical position
1324  hadX += p.x();
1325  hadY += p.y();
1326  hadZ += p.z();
1327  }
1328 
1329  return GlobalPoint(hadX/nConst, hadY/nConst, hadZ/nConst);
1330 }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
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 1333 of file CaloTowersCreationAlgo.cc.

References funct::abs(), CaloTowerConstituentsMap::constituentsOf(), CaloTowerTopology::convertCTtoHcal(), HcalDetId::depth(), CaloTowerTopology::firstHFRing(), hadShwPosFromCells(), DetId::Hcal, HcalForward, HcalOuter, i, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), mps_monitormerge::items, CaloTowerTopology::lastHERing(), point, HcalDetId::subdet(), theHcalPhase, theTowerConstituentsMap, theTowerTopology, and CaloTowerDetId::zside().

1333  {
1334 
1335  // set depth using geometry of cells that are associated with the
1336  // tower (regardless if they have non-zero energies)
1337 
1338 // if (hadE <= 0) return GlobalPoint(0, 0, 0);
1339 
1340  if (fracDepth < 0) fracDepth = 0;
1341  else if (fracDepth > 1) fracDepth = 1;
1342 
1343  GlobalPoint point(0,0,0);
1344 
1345  int iEta = towerId.ieta();
1346  int iPhi = towerId.iphi();
1347 
1348  HcalDetId frontCellId, backCellId;
1349 
1350  if(towerId.ietaAbs() >= theTowerTopology->firstHFRing()){
1351  // forward, take the geometry for long fibers
1352  frontCellId = HcalDetId(HcalForward, towerId.zside()*theTowerTopology->convertCTtoHcal(abs(iEta)), iPhi, 1);
1353  backCellId = HcalDetId(HcalForward, towerId.zside()*theTowerTopology->convertCTtoHcal(abs(iEta)), iPhi, 1);
1354  }
1355  else {
1356  //use constituents map
1357  std::vector<DetId> items = theTowerConstituentsMap->constituentsOf(towerId);
1358  int frontDepth = 1000;
1359  int backDepth = -1000;
1360  for(unsigned i = 0; i < items.size(); i++){
1361  if(items[i].det()!=DetId::Hcal) continue;
1362  HcalDetId hid(items[i]);
1363  if(hid.subdet() == HcalOuter) continue;
1364 
1365  if(hid.depth()<frontDepth) { frontCellId = hid; frontDepth = hid.depth(); }
1366  if(hid.depth()>backDepth) { backCellId = hid; backDepth = hid.depth(); }
1367  }
1368 
1369  //fix for tower 28/29 - no tower 29 at highest depths
1370  if(towerId.ietaAbs()==theTowerTopology->lastHERing() && (theHcalPhase==0 || theHcalPhase==1)){
1371  CaloTowerDetId towerId28(towerId.ieta()-towerId.zside(),towerId.iphi());
1372  std::vector<DetId> items28 = theTowerConstituentsMap->constituentsOf(towerId28);
1373  for(unsigned i = 0; i < items28.size(); i++){
1374  if(items28[i].det()!=DetId::Hcal) continue;
1375  HcalDetId hid(items28[i]);
1376  if(hid.subdet() == HcalOuter) continue;
1377 
1378  if(hid.depth()>backDepth) { backCellId = hid; backDepth = hid.depth(); }
1379  }
1380  }
1381  }
1382 
1383  point = hadShwPosFromCells(DetId(frontCellId), DetId(backCellId), fracDepth);
1384 
1385  return point;
1386 }
int i
Definition: DBlmapReader.cc:9
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CaloTowerConstituentsMap * theTowerConstituentsMap
const CaloTowerTopology * theTowerTopology
unsigned towerId(DetId const &)
Definition: DetId.h:18
GlobalPoint hadShwPosFromCells(DetId frontCell, DetId backCell, float fracDepth)
int lastHERing() const
int convertCTtoHcal(int ct_ieta) const
int firstHFRing() const
*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 1580 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().

1580  {
1581 
1582  const DetId id = hit->detid();
1583 
1584  const uint32_t recHitFlag = hit->flags();
1585  const uint32_t dbStatusFlag = theHcalChStatus->getValues(id)->getValue();
1586 
1587  int severityLevel = theHcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatusFlag);
1588  bool isRecovered = theHcalSevLvlComputer->recoveredRecHit(id, recHitFlag);
1589 
1590 
1591  // For use with hits rejected in the default reconstruction
1592  if (useRejectedHitsOnly) {
1593 
1594  if (!isRecovered) {
1595 
1596  if (severityLevel <= int(theHcalAcceptSeverityLevel) ||
1598  // this hit was either already accepted or is worse than
1599  }
1600  else {
1601 
1603  // skip recovered hits either because they were already used or because there was an explicit instruction
1605  }
1606  else if (useRejectedRecoveredHcalHits) {
1608  }
1609 
1610  } // recovered channels
1611 
1612  // clasify channels as problematic: no good hits are supposed to be present in the
1613  // extra rechit collections
1615 
1616  } // treatment of rejected hits
1617 
1618 
1619 
1620 
1621  // this is for the regular reconstruction sequence
1622 
1623  if (severityLevel == 0) return CaloTowersCreationAlgo::GoodChan;
1624 
1625  if (isRecovered) {
1626  return (theRecoveredHcalHitsAreUsed) ?
1628  }
1629  else {
1630  if (severityLevel > int(theHcalAcceptSeverityLevel)) {
1632  }
1633  else {
1635  }
1636  }
1637 
1638 }
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 1531 of file CaloTowersCreationAlgo.cc.

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

Referenced by CaloTowersCreator::produce().

1531  {
1532 
1533  // std::cout << "VI making EcalBadChs ";
1534 
1535  // for ECAL the number of all bad channels is obtained here -----------------------
1536 
1537  for (auto ind=0U; ind<theTowerTopology->sizeForDenseIndexing(); ++ind) {
1538 
1539  auto & numBadEcalChan = ecalBadChs[ind];
1540  numBadEcalChan=0;
1541  auto id = theTowerTopology->detIdFromDenseIndex(ind);
1542 
1543  // this is utterly slow... (can be optmized if really needed)
1544 
1545  // get all possible constituents of the tower
1546  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
1547 
1548  for (std::vector<DetId>::iterator ac_it=allConstituents.begin();
1549  ac_it!=allConstituents.end(); ++ac_it) {
1550 
1551  if (ac_it->det()!=DetId::Ecal) continue;
1552 
1553  auto thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it);
1554 
1555  // check if the Ecal severity is ok to keep
1556  std::vector<int>::const_iterator sevit = std::find(theEcalSeveritiesToBeExcluded.begin(),
1558  thisEcalSevLvl);
1559  if (sevit!=theEcalSeveritiesToBeExcluded.end()) {
1560  ++numBadEcalChan;
1561  }
1562  }
1563 
1564  // if (0!=numBadEcalChan) std::cout << id << ":" << numBadEcalChan << ", ";
1565  }
1566 
1567  /*
1568  int tot=0;
1569  for (auto ind=0U; ind<theTowerTopology->sizeForDenseIndexing(); ++ind) {
1570  if (ecalBadChs[ind]!=0) ++tot;
1571  }
1572  std::cout << " | " << tot << std::endl;
1573  */
1574 
1575 }
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 )
CaloTowerDetId detIdFromDenseIndex(uint32_t din) const
const CaloTowerConstituentsMap * theTowerConstituentsMap
const CaloTowerTopology * theTowerTopology
std::vector< int > theEcalSeveritiesToBeExcluded
std::vector< unsigned short > ecalBadChs
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
uint32_t sizeForDenseIndexing() const
void CaloTowersCreationAlgo::makeHcalDropChMap ( )

Definition at line 1494 of file CaloTowersCreationAlgo.cc.

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

Referenced by CaloTowersCreator::produce().

1494  {
1495 
1496  // This method fills the map of number of dead channels for the calotower,
1497  // The key of the map is CaloTowerDetId.
1498  // By definition these channels are not going to be in the RecHit collections.
1499  hcalDropChMap.clear();
1500  std::vector<DetId> allChanInStatusCont = theHcalChStatus->getAllChannels();
1501 
1502  for (std::vector<DetId>::iterator it = allChanInStatusCont.begin(); it!=allChanInStatusCont.end(); ++it) {
1503 
1504  const uint32_t dbStatusFlag = theHcalChStatus->getValues(*it)->getValue();
1505 
1506  if (theHcalSevLvlComputer->dropChannel(dbStatusFlag)) {
1507 
1509 
1510  hcalDropChMap[twrId] +=1;
1511 
1512  HcalDetId hid(*it);
1513 
1514  // special case for tower 29: if HCAL hit is in depth 3 add to twr 29 as well
1515  if (hid.subdet()==HcalEndcap &&
1516  (theHcalPhase==0 || theHcalPhase==1) &&
1517  std::find(mergedDepths.begin(), mergedDepths.end(), hid.depth())!=mergedDepths.end() &&
1518  hid.ietaAbs()==theHcalTopology->lastHERing()-1) {
1519 
1520  CaloTowerDetId twrId29(twrId.ieta()+twrId.zside(), twrId.iphi());
1521  hcalDropChMap[twrId29] +=1;
1522  }
1523 
1524  }
1525 
1526  }
1527 
1528 }
const HcalChannelQuality * theHcalChStatus
const Item * getValues(DetId fId, bool throwOnFail=true) const
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)
std::vector< DetId > getAllChannels() const
int iphi() const
get the tower iphi
bool dropChannel(const uint32_t &mystatus) const
const CaloTowerConstituentsMap * theTowerConstituentsMap
std::vector< int > mergedDepths
const HcalSeverityLevelComputer * theHcalSevLvlComputer
int zside() const
get the z-side of the tower (1/-1)
const HcalTopology * theHcalTopology
int ieta() const
get the tower ieta
uint32_t getValue() const
int lastHERing() const
Definition: HcalTopology.h:86
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 769 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().

769  {
770  double threshold, weight;
771  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(ct->id());
772  if (towerDetId.null()) return;
773  MetaTower & tower = find(towerDetId);
774 
775  tower.E_em = 0.;
776  tower.E_had = 0.;
777  tower.E_outer = 0.;
778  for (unsigned int i=0; i<ct->constituentsSize(); i++) {
779  DetId detId = ct->constituent(i);
780  getThresholdAndWeight(detId, threshold, weight);
781  DetId::Detector det = detId.det();
782  if(det == DetId::Ecal) {
783  tower.E_em = ct->emEnergy()*weight;
784  }
785  else {
786  HcalDetId hcalDetId(detId);
787  if(hcalDetId.subdet() == HcalForward) {
788  if (hcalDetId.depth()==1) tower.E_em = ct->emEnergy()*weight;
789  if (hcalDetId.depth()==2) tower.E_had = ct->hadEnergy()*weight;
790  }
791  else if(hcalDetId.subdet() == HcalOuter) {
792  tower.E_outer = ct->outerEnergy()*weight;
793  }
794  else {
795  tower.E_had = ct->hadEnergy()*weight;
796  }
797  }
798  tower.E = tower.E_had+tower.E_em+tower.E_outer;
799 
800  // this is to be compliant with the new MetaTower setup
801  // used only for the default simple vector assignment
802  std::pair<DetId, float> mc(detId, 0);
803  tower.metaConstituents.push_back(mc);
804  }
805 
806  // preserve time inforamtion
807  tower.emSumTimeTimesE = ct->ecalTime();
808  tower.hadSumTimeTimesE = ct->hcalTime();
809  tower.emSumEForTime = 1.0;
810  tower.hadSumEForTime = 1.0;
811 }
int i
Definition: DBlmapReader.cc:9
size_t constituentsSize() const
Definition: CaloTower.h:102
DetId constituent(size_t i) const
Definition: CaloTower.h:103
float ecalTime() const
Definition: CaloTower.h:178
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:107
const CaloTowerConstituentsMap * theTowerConstituentsMap
double hadEnergy() const
Definition: CaloTower.h:108
Definition: DetId.h:18
CaloTowerDetId id() const
Definition: CaloTower.h:100
float hcalTime() const
Definition: CaloTower.h:179
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:109
void CaloTowersCreationAlgo::rescaleTowers ( const CaloTowerCollection ctInput,
CaloTowerCollection ctResult 
)

Definition at line 350 of file CaloTowersCreationAlgo.cc.

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

Referenced by CaloTowersReCreator::produce().

350  {
351 
352  for (CaloTowerCollection::const_iterator ctcItr = ctc.begin();
353  ctcItr != ctc.end(); ++ctcItr) {
354 
355  CaloTowerDetId twrId = ctcItr->id();
356  double newE_em = ctcItr->emEnergy();
357  double newE_had = ctcItr->hadEnergy();
358  double newE_outer = ctcItr->outerEnergy();
359 
360  double threshold = 0.0; // not used: we do not change thresholds
361  double weight = 1.0;
362 
363  // HF
364  if (ctcItr->ietaAbs()>=theTowerTopology->firstHFRing()) {
365  double E_short = 0.5 * newE_had; // from the definitions for HF
366  double E_long = newE_em + 0.5 * newE_had; //
367  // scale
368  E_long *= theHF1weight;
369  E_short *= theHF2weight;
370  // convert
371  newE_em = E_long - E_short;
372  newE_had = 2.0 * E_short;
373  }
374 
375  else { // barrel/endcap
376 
377  // find if its in EB, or EE; determine from first ecal constituent found
378  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
379  DetId constId = ctcItr->constituent(iConst);
380  if (constId.det()!=DetId::Ecal) continue;
381  getThresholdAndWeight(constId, threshold, weight);
382  newE_em *= weight;
383  break;
384  }
385  // HO
386  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
387  DetId constId = ctcItr->constituent(iConst);
388  if (constId.det()!=DetId::Hcal) continue;
389  if (HcalDetId(constId).subdet()!=HcalOuter) continue;
390  getThresholdAndWeight(constId, threshold, weight);
391  newE_outer *= weight;
392  break;
393  }
394  // HB/HE
395  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
396  DetId constId = ctcItr->constituent(iConst);
397  if (constId.det()!=DetId::Hcal) continue;
398  if (HcalDetId(constId).subdet()==HcalOuter) continue;
399  getThresholdAndWeight(constId, threshold, weight);
400  newE_had *= weight;
401  if (ctcItr->ietaAbs()>theTowerTopology->firstHERing()) newE_outer *= weight;
402  break;
403  }
404 
405  } // barrel/endcap region
406 
407  // now make the new tower
408 
409  double newE_hadTot = (theHOIsUsed && twrId.ietaAbs()<=theTowerTopology->lastHORing())? newE_had+newE_outer : newE_had;
410 
411  GlobalPoint emPoint = ctcItr->emPosition();
412  GlobalPoint hadPoint = ctcItr->emPosition();
413 
414  double f_em = 1.0/cosh(emPoint.eta());
415  double f_had = 1.0/cosh(hadPoint.eta());
416 
418 
419  if (ctcItr->ietaAbs()<theTowerTopology->firstHFRing()) {
420  if (newE_em>0) towerP4 += CaloTower::PolarLorentzVector(newE_em*f_em, emPoint.eta(), emPoint.phi(), 0);
421  if (newE_hadTot>0) towerP4 += CaloTower::PolarLorentzVector(newE_hadTot*f_had, hadPoint.eta(), hadPoint.phi(), 0);
422  }
423  else {
424  double newE_tot = newE_em + newE_had;
425  // for HF we use common point for ecal, hcal shower positions regardless of the method
426  if (newE_tot>0) towerP4 += CaloTower::PolarLorentzVector(newE_tot*f_had, hadPoint.eta(), hadPoint.phi(), 0);
427  }
428 
429 
430 
431  CaloTower rescaledTower(twrId, newE_em, newE_had, newE_outer, -1, -1, towerP4, emPoint, hadPoint);
432  // copy the timings, have to convert back to int, 1 unit = 0.01 ns
433  rescaledTower.setEcalTime( int(ctcItr->ecalTime()*100.0 + 0.5) );
434  rescaledTower.setHcalTime( int(ctcItr->hcalTime()*100.0 + 0.5) );
435  //add topology info
436  rescaledTower.setHcalSubdet(theTowerTopology->lastHBRing(),
440 
441  std::vector<DetId> contains;
442  for (unsigned int iConst = 0; iConst < ctcItr->constituentsSize(); ++iConst) {
443  contains.push_back(ctcItr->constituent(iConst));
444  }
445  rescaledTower.addConstituents(contains);
446 
447  rescaledTower.setCaloTowerStatus(ctcItr->towerStatusWord());
448 
449  ctcResult.push_back(rescaledTower);
450 
451  } // end of loop over towers
452 
453 
454 }
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
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
int firstHERing() const
int lastHFRing() const
const CaloTowerTopology * theTowerTopology
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 lastHERing() const
int lastHORing() const
int lastHBRing() const
int firstHFRing() const
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 1240 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theEBEScale.

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

1240  {
1241  if (scale>0.00001) *&theEBEScale = scale;
1242  else *&theEBEScale = 50.;
1243 }
void CaloTowersCreationAlgo::setEbHandle ( const edm::Handle< EcalRecHitCollection eb)
inline

Definition at line 192 of file CaloTowersCreationAlgo.h.

References theEbHandle.

Referenced by CaloTowersCreator::produce().

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

Definition at line 115 of file CaloTowersCreationAlgo.h.

References alignCSCRings::s, and theEcalChStatus.

Referenced by CaloTowersCreator::produce().

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

Definition at line 159 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 180 of file CaloTowersCreationAlgo.h.

References theEcalSeveritiesToBeUsedInBadTowers.

Referenced by CaloTowersCreator::produce().

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

Definition at line 169 of file CaloTowersCreationAlgo.h.

References a, and theEcalSevLvlAlgo.

Referenced by CaloTowersCreator::produce().

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

Definition at line 1245 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theEEEScale.

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

1245  {
1246  if (scale>0.00001) *&theEEEScale = scale;
1247  else *&theEEEScale = 50.;
1248 }
void CaloTowersCreationAlgo::setEeHandle ( const edm::Handle< EcalRecHitCollection ee)
inline

Definition at line 193 of file CaloTowersCreationAlgo.h.

References theEeHandle.

Referenced by CaloTowersCreator::produce().

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

Definition at line 250 of file CaloTowersCreationAlgo.cc.

References DetId::Calo, HcalTopology::depthBinInformation(), ecalBadChs, HcalTopology::getDepthSegmentation(), CaloGeometry::getSubdetectorGeometry(), HcalEndcap, i, HcalTopology::lastHERing(), mergedDepths, min(), CaloTowerTopology::sizeForDenseIndexing(), CaloTowerDetId::SubdetId, theGeometry, theHcalPhase, theHcalTopology, theTowerConstituentsMap, theTowerGeometry, and theTowerTopology.

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

250  {
251  theTowerTopology = cttopo;
252  theTowerConstituentsMap = ctmap;
253  theHcalTopology = htopo;
254  theGeometry = geo;
256 
257  //initialize ecal bad channel map
259 
260  //store some specific geom info
261 
262  //which depths of tower 28/29 are merged?
263  //the merging starts at layer 5 in phase 0 or phase 1 configurations
264  if(theHcalPhase==0 || theHcalPhase==1){
265  std::vector<int> tower28depths;
266  int ndepths, startdepth;
269 
270  //keep track of which depths are merged
271  //layer 5 = index 6 (layers start at -1)
272  std::vector<bool> isMergedDepth(ndepths,true);
273  for(int i = 0; i < std::min(6,(int)(tower28depths.size())); i++){
274  isMergedDepth[tower28depths[i]-startdepth] = false;
275  }
276 
277  //store true merged depths
278  for(int i = 0; i < ndepths; i++){
279  if(isMergedDepth[i]) mergedDepths.push_back(i+startdepth);
280  }
281 
282  }
283 
284 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:43
int i
Definition: DBlmapReader.cc:9
const CaloSubdetectorGeometry * theTowerGeometry
static const int SubdetId
const CaloGeometry * theGeometry
void depthBinInformation(HcalSubdetector subdet, int etaRing, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
const CaloTowerConstituentsMap * theTowerConstituentsMap
const CaloTowerTopology * theTowerTopology
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< int > mergedDepths
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
const HcalTopology * theHcalTopology
std::vector< unsigned short > ecalBadChs
uint32_t sizeForDenseIndexing() const
int lastHERing() const
Definition: HcalTopology.h:86
void CaloTowersCreationAlgo::setHBEScale ( double  scale)

Definition at line 1250 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHBEScale.

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

1250  {
1251  if (scale>0.00001) *&theHBEScale = scale;
1252  else *&theHBEScale = 50.;
1253 }
void CaloTowersCreationAlgo::setHcalAcceptSeverityLevel ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setHcalAcceptSeverityLevelForRejectedHit ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setHcalChStatusFromDB ( const HcalChannelQuality s)
inline

Definition at line 114 of file CaloTowersCreationAlgo.h.

References alignCSCRings::s, and theHcalChStatus.

Referenced by CaloTowersCreator::produce().

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

Definition at line 166 of file CaloTowersCreationAlgo.h.

References EnergyCorrector::c, and theHcalSevLvlComputer.

Referenced by CaloTowersCreator::produce().

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

Definition at line 1260 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHEDEScale.

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

1260  {
1261  if (scale>0.00001) *&theHEDEScale = scale;
1262  else *&theHEDEScale = 50.;
1263 }
void CaloTowersCreationAlgo::setHESEScale ( double  scale)

Definition at line 1255 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHESEScale.

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

1255  {
1256  if (scale>0.00001) *&theHESEScale = scale;
1257  else *&theHESEScale = 50.;
1258 }
void CaloTowersCreationAlgo::setHF1EScale ( double  scale)

Definition at line 1270 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHF1EScale.

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

1270  {
1271  if (scale>0.00001) *&theHF1EScale = scale;
1272  else *&theHF1EScale = 50.;
1273 }
void CaloTowersCreationAlgo::setHF2EScale ( double  scale)

Definition at line 1275 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHF2EScale.

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

1275  {
1276  if (scale>0.00001) *&theHF2EScale = scale;
1277  else *&theHF2EScale = 50.;
1278 }
void CaloTowersCreationAlgo::setHOEScale ( double  scale)

Definition at line 1265 of file CaloTowersCreationAlgo.cc.

References pileupReCalc_HLTpaths::scale, and theHOEScale.

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

1265  {
1266  if (scale>0.00001) *&theHOEScale = scale;
1267  else *&theHOEScale = 50.;
1268 }
void CaloTowersCreationAlgo::setRecoveredEcalHitsAreUsed ( bool  flag)
inline
void CaloTowersCreationAlgo::setRecoveredHcalHitsAreUsed ( bool  flag)
inline
void CaloTowersCreationAlgo::setUseRejectedHitsOnly ( bool  flag)
inline

Definition at line 176 of file CaloTowersCreationAlgo.h.

References useRejectedHitsOnly.

Referenced by CaloTowersCreator::produce().

void CaloTowersCreationAlgo::setUseRejectedRecoveredEcalHits ( bool  flag)
inline

Definition at line 184 of file CaloTowersCreationAlgo.h.

References useRejectedRecoveredEcalHits.

Referenced by CaloTowersCreator::produce().

void CaloTowersCreationAlgo::setUseRejectedRecoveredHcalHits ( bool  flag)
inline

Definition at line 183 of file CaloTowersCreationAlgo.h.

References useRejectedRecoveredHcalHits.

Referenced by CaloTowersCreator::produce().

Member Data Documentation

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

Definition at line 342 of file CaloTowersCreationAlgo.h.

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

HcalDropChMap CaloTowersCreationAlgo::hcalDropChMap
private

Definition at line 338 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and makeHcalDropChMap().

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

Definition at line 356 of file CaloTowersCreationAlgo.h.

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

int CaloTowersCreationAlgo::nalgo =-1

Definition at line 52 of file CaloTowersCreationAlgo.h.

double CaloTowersCreationAlgo::theEBEScale
private

Definition at line 268 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEBEScale().

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

Definition at line 256 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 352 of file CaloTowersCreationAlgo.h.

Referenced by setEbHandle().

double CaloTowersCreationAlgo::theEBSumThreshold
private

Definition at line 266 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEBthreshold
private

Definition at line 246 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theEBweight
private

Definition at line 264 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 256 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

const EcalChannelStatus* CaloTowersCreationAlgo::theEcalChStatus
private

Definition at line 283 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 266 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEEEScale
private

Definition at line 269 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEEEScale().

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

Definition at line 257 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 353 of file CaloTowersCreationAlgo.h.

Referenced by setEeHandle().

double CaloTowersCreationAlgo::theEESumThreshold
private

Definition at line 266 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEEthreshold
private

Definition at line 246 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theEEweight
private

Definition at line 264 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 257 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 270 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHBEScale().

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

Definition at line 258 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHBthreshold
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHBweight
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 258 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 251 of file CaloTowersCreationAlgo.h.

Referenced by convert().

const HcalTopology* CaloTowersCreationAlgo::theHcalTopology
private
double CaloTowersCreationAlgo::theHEDEScale
private

Definition at line 272 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHEDEScale().

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

Definition at line 260 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHEDthreshold
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHEDweight
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 260 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESEScale
private

Definition at line 271 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHESEScale().

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

Definition at line 259 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESthreshold
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESweight
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 259 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1EScale
private

Definition at line 274 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF1EScale().

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

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1threshold
private

Definition at line 255 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1weight
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

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

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2EScale
private

Definition at line 275 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF2EScale().

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

Definition at line 263 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2threshold
private

Definition at line 255 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2weight
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

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

Definition at line 263 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOEScale
private

Definition at line 273 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHOEScale().

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

Definition at line 261 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 314 of file CaloTowersCreationAlgo.h.

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

double CaloTowersCreationAlgo::theHOthreshold0
private

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdMinus1
private

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdMinus2
private

Definition at line 255 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdPlus1
private

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdPlus2
private

Definition at line 255 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOweight
private

Definition at line 265 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 261 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

int CaloTowersCreationAlgo::theMomConstrMethod
private

Definition at line 318 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomEBDepth
private

Definition at line 321 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomEEDepth
private

Definition at line 322 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomHBDepth
private

Definition at line 319 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomHEDepth
private

Definition at line 320 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 280 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and setGeometry().

MetaTowerMap CaloTowersCreationAlgo::theTowerMap
private

Definition at line 332 of file CaloTowersCreationAlgo.h.

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

unsigned int CaloTowersCreationAlgo::theTowerMapSize =0
private

Definition at line 333 of file CaloTowersCreationAlgo.h.

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

const CaloTowerTopology* CaloTowersCreationAlgo::theTowerTopology
private
bool CaloTowersCreationAlgo::theUseEtEBTresholdFlag
private

Definition at line 247 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::theUseEtEETresholdFlag
private

Definition at line 247 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::theUseSymEBTresholdFlag
private

Definition at line 248 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

bool CaloTowersCreationAlgo::theUseSymEETresholdFlag
private

Definition at line 248 of file CaloTowersCreationAlgo.h.

Referenced by assignHitEcal().

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