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 | Private Types | Private Member Functions | Private Attributes
CaloTowersCreationAlgo Class Reference

#include <CaloTowersCreationAlgo.h>

Classes

struct  MetaTower
 

Public Member Functions

void begin ()
 
 CaloTowersCreationAlgo ()
 
 CaloTowersCreationAlgo (double EBthreshold, double EEthreshold, bool useEtEBTreshold, bool useEtEETreshold, bool useSymEBTreshold, bool useSymEETreshold, double HcalThreshold, double HBthreshold, double HESthreshold, double HEDthreshold, double HOthreshold0, double HOthresholdPlus1, double HOthresholdMinus1, double HOthresholdPlus2, double HOthresholdMinus2, double HF1threshold, double HF2threshold, double EBweight, double EEweight, double HBweight, double HESweight, double HEDweight, double HOweight, double HF1weight, double HF2weight, double EcutTower, double EBSumThreshold, double EESumThreshold, bool useHO, int momConstrMethod, double momHBDepth, double momHEDepth, double momEBDepth, double momEEDepth)
 
 CaloTowersCreationAlgo (double EBthreshold, double EEthreshold, bool useEtEBTreshold, bool useEtEETreshold, bool useSymEBTreshold, bool useSymEETreshold, double HcalThreshold, double HBthreshold, double HESthreshold, double HEDthreshold, double HOthreshold0, double HOthresholdPlus1, double HOthresholdMinus1, double HOthresholdPlus2, double HOthresholdMinus2, double HF1threshold, double HF2threshold, const std::vector< double > &EBGrid, const std::vector< double > &EBWeights, const std::vector< double > &EEGrid, const std::vector< double > &EEWeights, const std::vector< double > &HBGrid, const std::vector< double > &HBWeights, const std::vector< double > &HESGrid, const std::vector< double > &HESWeights, const std::vector< double > &HEDGrid, const std::vector< double > &HEDWeights, const std::vector< double > &HOGrid, const std::vector< double > &HOWeights, const std::vector< double > &HF1Grid, const std::vector< double > &HF1Weights, const std::vector< double > &HF2Grid, const std::vector< double > &HF2Weights, double EBweight, double EEweight, double HBweight, double HESweight, double HEDweight, double HOweight, double HF1weight, double HF2weight, double EcutTower, double EBSumThreshold, double EESumThreshold, bool useHO, int momConstrMethod, double momHBDepth, double momHEDepth, double momEBDepth, double momEEDepth)
 
unsigned int ecalChanStatusForCaloTower (const CaloRecHit *hit)
 
GlobalPoint emCrystalShwrPos (DetId detId, float fracDepth)
 
GlobalPoint emShwrLogWeightPos (const std::vector< std::pair< DetId, double > > &metaContains, float fracDepth, double totEmE)
 
GlobalPoint emShwrPos (const std::vector< std::pair< DetId, double > > &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, double > > &metaContains, float fracDepth, double hadE)
 
GlobalPoint hadShwrPos (CaloTowerDetId id, float fracDepth)
 
unsigned int hcalChanStatusForCaloTower (const CaloRecHit *hit)
 
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 setEcalAcceptSeverityLevel (unsigned int level)
 
void setEcalAcceptSeverityLevelForRejectedHit (unsigned int level)
 
void setEcalChStatusFromDB (const EcalChannelStatus *s)
 
void setEcalSevLvlAlgo (const EcalSeverityLevelAlgo *a)
 
void setEEEScale (double scale)
 
void setEeHandle (const edm::Handle< EcalRecHitCollection > ee)
 
void setGeometry (const CaloTowerConstituentsMap *cttopo, const HcalTopology *htopo, const CaloGeometry *geo)
 
void setHBEScale (double scale)
 
void setHcalAcceptSeverityLevel (unsigned int level)
 
void setHcalAcceptSeverityLevelForRejectedHit (unsigned int level)
 
void setHcalChStatusFromDB (const HcalChannelQuality *s)
 
void setHcalSevLvlComputer (const HcalSeverityLevelComputer *c)
 
void setHEDEScale (double scale)
 
void setHESEScale (double scale)
 
void setHF1EScale (double scale)
 
void setHF2EScale (double scale)
 
void setHOEScale (double scale)
 
void setRecoveredEcalHitsAreUsed (bool flag)
 
void setRecoveredHcalHitsAreUsed (bool flag)
 
void setUseRejectedHitsOnly (bool flag)
 
void setUseRejectedRecoveredEcalHits (bool flag)
 
void setUseRejectedRecoveredHcalHits (bool flag)
 

Private Types

enum  ctHitCategory {
  GoodChan = 0, BadChan = 1, RecoveredChan = 2, ProblematicChan = 3,
  IgnoredChan = 99
}
 
typedef std::map
< CaloTowerDetId, int > 
HcalDropChMap
 
typedef std::map
< CaloTowerDetId, MetaTower
MetaTowerMap
 

Private Member Functions

void assignHit (const CaloRecHit *recHit)
 adds a single hit to the tower More...
 
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

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

Detailed Description

Date:
2010/11/24 19:52:15
Revision:
1.19
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 321 of file CaloTowersCreationAlgo.h.

Definition at line 316 of file CaloTowersCreationAlgo.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CaloTowersCreationAlgo::CaloTowersCreationAlgo ( )

Definition at line 10 of file CaloTowersCreationAlgo.cc.

11  : theEBthreshold(-1000.),
12  theEEthreshold(-1000.),
13 
18 
19 
20  theHcalThreshold(-1000.),
21  theHBthreshold(-1000.),
22  theHESthreshold(-1000.),
23  theHEDthreshold(-1000.),
24  theHOthreshold0(-1000.),
25  theHOthresholdPlus1(-1000.),
26  theHOthresholdMinus1(-1000.),
27  theHOthresholdPlus2(-1000.),
28  theHOthresholdMinus2(-1000.),
29  theHF1threshold(-1000.),
30  theHF2threshold(-1000.),
31  theEBGrid(std::vector<double>(5,10.)),
32  theEBWeights(std::vector<double>(5,1.)),
33  theEEGrid(std::vector<double>(5,10.)),
34  theEEWeights(std::vector<double>(5,1.)),
35  theHBGrid(std::vector<double>(5,10.)),
36  theHBWeights(std::vector<double>(5,1.)),
37  theHESGrid(std::vector<double>(5,10.)),
38  theHESWeights(std::vector<double>(5,1.)),
39  theHEDGrid(std::vector<double>(5,10.)),
40  theHEDWeights(std::vector<double>(5,1.)),
41  theHOGrid(std::vector<double>(5,10.)),
42  theHOWeights(std::vector<double>(5,1.)),
43  theHF1Grid(std::vector<double>(5,10.)),
44  theHF1Weights(std::vector<double>(5,1.)),
45  theHF2Grid(std::vector<double>(5,10.)),
46  theHF2Weights(std::vector<double>(5,1.)),
47  theEBweight(1.),
48  theEEweight(1.),
49  theHBweight(1.),
50  theHESweight(1.),
51  theHEDweight(1.),
52  theHOweight(1.),
53  theHF1weight(1.),
54  theHF2weight(1.),
55  theEcutTower(-1000.),
56  theEBSumThreshold(-1000.),
57  theEESumThreshold(-1000.),
58  theHcalTopology(0),
59  theGeometry(0),
61  theHOIsUsed(true),
62  // (for momentum reconstruction algorithm)
64  theMomHBDepth(0.),
65  theMomHEDepth(0.),
66  theMomEBDepth(0.),
67  theMomEEDepth(0.)
68 {
69 }
std::vector< double > theHBGrid
std::vector< double > theHESGrid
std::vector< double > theHEDGrid
std::vector< double > theHOWeights
std::vector< double > theEEGrid
std::vector< double > theEEWeights
std::vector< double > theHESWeights
std::vector< double > theHF2Grid
std::vector< double > theHEDWeights
const CaloGeometry * theGeometry
std::vector< double > theHOGrid
const CaloTowerConstituentsMap * theTowerConstituentsMap
std::vector< double > theHF1Weights
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
std::vector< double > theHBWeights
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
std::vector< double > theEBWeights
CaloTowersCreationAlgo::CaloTowersCreationAlgo ( double  EBthreshold,
double  EEthreshold,
bool  useEtEBTreshold,
bool  useEtEETreshold,
bool  useSymEBTreshold,
bool  useSymEETreshold,
double  HcalThreshold,
double  HBthreshold,
double  HESthreshold,
double  HEDthreshold,
double  HOthreshold0,
double  HOthresholdPlus1,
double  HOthresholdMinus1,
double  HOthresholdPlus2,
double  HOthresholdMinus2,
double  HF1threshold,
double  HF2threshold,
double  EBweight,
double  EEweight,
double  HBweight,
double  HESweight,
double  HEDweight,
double  HOweight,
double  HF1weight,
double  HF2weight,
double  EcutTower,
double  EBSumThreshold,
double  EESumThreshold,
bool  useHO,
int  momConstrMethod,
double  momHBDepth,
double  momHEDepth,
double  momEBDepth,
double  momEEDepth 
)

Definition at line 71 of file CaloTowersCreationAlgo.cc.

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

Definition at line 152 of file CaloTowersCreationAlgo.cc.

183  : theEBthreshold(EBthreshold),
184  theEEthreshold(EEthreshold),
185 
186  theUseEtEBTresholdFlag(useEtEBTreshold),
187  theUseEtEETresholdFlag(useEtEETreshold),
188  theUseSymEBTresholdFlag(useSymEBTreshold),
189  theUseSymEETresholdFlag(useSymEETreshold),
190 
191  theHcalThreshold(HcalThreshold),
192  theHBthreshold(HBthreshold),
193  theHESthreshold(HESthreshold),
194  theHEDthreshold(HEDthreshold),
195  theHOthreshold0(HOthreshold0),
196  theHOthresholdPlus1(HOthresholdPlus1),
197  theHOthresholdMinus1(HOthresholdMinus1),
198  theHOthresholdPlus2(HOthresholdPlus2),
199  theHOthresholdMinus2(HOthresholdMinus2),
200  theHF1threshold(HF1threshold),
201  theHF2threshold(HF2threshold),
202  theEBGrid(EBGrid),
203  theEBWeights(EBWeights),
204  theEEGrid(EEGrid),
205  theEEWeights(EEWeights),
206  theHBGrid(HBGrid),
207  theHBWeights(HBWeights),
208  theHESGrid(HESGrid),
209  theHESWeights(HESWeights),
210  theHEDGrid(HEDGrid),
211  theHEDWeights(HEDWeights),
212  theHOGrid(HOGrid),
213  theHOWeights(HOWeights),
214  theHF1Grid(HF1Grid),
215  theHF1Weights(HF1Weights),
216  theHF2Grid(HF2Grid),
217  theHF2Weights(HF2Weights),
218  theEBweight(EBweight),
219  theEEweight(EEweight),
220  theHBweight(HBweight),
221  theHESweight(HESweight),
222  theHEDweight(HEDweight),
223  theHOweight(HOweight),
224  theHF1weight(HF1weight),
225  theHF2weight(HF2weight),
226  theEcutTower(EcutTower),
227  theEBSumThreshold(EBSumThreshold),
228  theEESumThreshold(EESumThreshold),
229  theHOIsUsed(useHO),
230  // (momentum reconstruction algorithm)
231  theMomConstrMethod(momConstrMethod),
232  theMomHBDepth(momHBDepth),
233  theMomHEDepth(momHEDepth),
234  theMomEBDepth(momEBDepth),
235  theMomEEDepth(momEEDepth)
236 
237 {
238 }
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::assignHit ( const CaloRecHit recHit)
private

adds a single hit to the tower

Definition at line 407 of file CaloTowersCreationAlgo.cc.

References BadChan, HcalDetId::depth(), DetId::det(), CaloRecHit::detid(), CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_em, CaloTowersCreationAlgo::MetaTower::E_had, CaloTowersCreationAlgo::MetaTower::E_outer, DetId::Ecal, EcalBarrel, ecalChanStatusForCaloTower(), EcalEndcap, CaloTowersCreationAlgo::MetaTower::emSumEForTime, CaloTowersCreationAlgo::MetaTower::emSumTimeTimesE, CaloRecHit::energy(), relval_parameters_module::energy, eta(), find(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), getThresholdAndWeight(), GoodChan, CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalChanStatusForCaloTower(), HcalEndcap, HcalForward, HcalOuter, CaloTowerDetId::ieta(), HcalDetId::ietaAbs(), IgnoredChan, CaloTowerDetId::iphi(), CaloTowersCreationAlgo::MetaTower::metaConstituents, DetId::null(), CaloTowersCreationAlgo::MetaTower::numBadHcalCells, CaloTowersCreationAlgo::MetaTower::numProbEcalCells, CaloTowersCreationAlgo::MetaTower::numProbHcalCells, CaloTowersCreationAlgo::MetaTower::numRecEcalCells, CaloTowersCreationAlgo::MetaTower::numRecHcalCells, ProblematicChan, RecoveredChan, HcalDetId::subdet(), DetId::subdetId(), theGeometry, theHOIsUsed, theTowerConstituentsMap, theUseEtEBTresholdFlag, theUseEtEETresholdFlag, theUseSymEBTresholdFlag, theUseSymEETresholdFlag, dtT0WireCalibration_cfg::threshold, CaloRecHit::time(), CaloTowerConstituentsMap::towerOf(), CommonMethods::weight(), and CaloTowerDetId::zside().

Referenced by process().

407  {
408  DetId detId = recHit->detid();
409 
410  unsigned int chStatusForCT = (detId.det()==DetId::Hcal)?
413 
414  // this is for skipping channls: mostly needed for the creation of
415  // bad towers from hits i the bad channel collections.
416  if (chStatusForCT==CaloTowersCreationAlgo::IgnoredChan) return;
417 
418  double threshold, weight;
419  getThresholdAndWeight(detId, threshold, weight);
420 
421  double energy = recHit->energy(); // original RecHit energy is used to apply thresholds
422  double e = energy * weight; // energies scaled by user weight: used in energy assignments
423 
424 
425  // SPECIAL handling of tower 28/depth 3 --> half into tower 28 and half into tower 29
426  if (detId.det()==DetId::Hcal &&
427  HcalDetId(detId).subdet()==HcalEndcap &&
428  HcalDetId(detId).depth()==3 &&
429  HcalDetId(detId).ietaAbs()==28) {
430 
432 
433  // bad channels are counted regardless of energy threshold
434 
435  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
436  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
437  if (towerDetId.null()) return;
438  MetaTower & tower28 = find(towerDetId);
439  CaloTowerDetId towerDetId29(towerDetId.ieta()+towerDetId.zside(),
440  towerDetId.iphi());
441  MetaTower & tower29 = find(towerDetId29);
442  tower28.numBadHcalCells += 1;
443  tower29.numBadHcalCells += 1;
444  }
445 
446  else if (0.5*energy >= threshold) { // not bad channel: use energy if above threshold
447 
448  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
449  if (towerDetId.null()) return;
450  MetaTower & tower28 = find(towerDetId);
451  CaloTowerDetId towerDetId29(towerDetId.ieta()+towerDetId.zside(),
452  towerDetId.iphi());
453  MetaTower & tower29 = find(towerDetId29);
454 
455  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
456  tower28.numRecHcalCells += 1;
457  tower29.numRecHcalCells += 1;
458  }
459  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
460  tower28.numProbHcalCells += 1;
461  tower29.numProbHcalCells += 1;
462  }
463 
464  // NOTE DIVIDE BY 2!!!
465  double e28 = 0.5 * e;
466  double e29 = 0.5 * e;
467 
468  tower28.E_had += e28;
469  tower28.E += e28;
470  std::pair<DetId,double> mc(detId,e28);
471  tower28.metaConstituents.push_back(mc);
472 
473  tower29.E_had += e29;
474  tower29.E += e29;
475  tower29.metaConstituents.push_back(mc);
476 
477  // time info: do not use in averaging if timing error is found: need
478  // full set of status info to implement: use only "good" channels for now
479 
480  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
481  tower28.hadSumTimeTimesE += ( e28 * recHit->time() );
482  tower28.hadSumEForTime += e28;
483  tower29.hadSumTimeTimesE += ( e29 * recHit->time() );
484  tower29.hadSumEForTime += e29;
485  }
486 
487  // store the energy in layer 3 also in E_outer
488  tower28.E_outer += e28;
489  tower29.E_outer += e29;
490  } // not a "bad" hit
491 
492  } // end of special case
493 
494  else {
495 
496  DetId::Detector det = detId.det();
497 
498  if (det == DetId::Ecal) {
499 
501 
502  // For ECAL we count all bad channels after the metatower is complete
503 
504  // Include options for symmetric thresholds and cut on Et
505  // for ECAL RecHits
506 
507  bool passEmThreshold = false;
508 
509  if (detId.subdetId() == EcalBarrel) {
510  if (theUseEtEBTresholdFlag) energy /= cosh( (theGeometry->getGeometry(detId)->getPosition()).eta() ) ;
511  if (theUseSymEBTresholdFlag) passEmThreshold = (fabs(energy) >= threshold);
512  else passEmThreshold = (energy >= threshold);
513 
514  }
515  else if (detId.subdetId() == EcalEndcap) {
516  if (theUseEtEETresholdFlag) energy /= cosh( (theGeometry->getGeometry(detId)->getPosition()).eta() ) ;
517  if (theUseSymEETresholdFlag) passEmThreshold = (fabs(energy) >= threshold);
518  else passEmThreshold = (energy >= threshold);
519  }
520 
521 
522  // if (chStatusForCT != CaloTowersCreationAlgo::BadChan && energy >= threshold) {
523  if (chStatusForCT != CaloTowersCreationAlgo::BadChan && passEmThreshold) {
524  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
525  if (towerDetId.null()) return;
526  MetaTower & tower = find(towerDetId);
527  tower.E_em += e;
528  tower.E += e;
529 
530  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
531  tower.numRecEcalCells += 1;
532  }
533  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
534  tower.numProbEcalCells += 1;
535  }
536 
537  // change when full status info is available
538  // for now use only good channels
539 
540  // add e>0 check (new options allow e<0)
541  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan && e>0 ) {
542  tower.emSumTimeTimesE += ( e * recHit->time() );
543  tower.emSumEForTime += e; // see above
544  }
545 
546  std::pair<DetId,double> mc(detId,e);
547  tower.metaConstituents.push_back(mc);
548  }
549 
550  } // end of ECAL
551 
552  // HCAL
553  else {
554  HcalDetId hcalDetId(detId);
555 
557 
558  if(hcalDetId.subdet() == HcalOuter) {
559 
560  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
561  if (towerDetId.null()) return;
562  MetaTower & tower = find(towerDetId);
563 
564  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
565  if (theHOIsUsed) tower.numBadHcalCells += 1;
566  }
567 
568  else if (energy >= threshold) {
569  tower.E_outer += e; // store HO energy even if HO is not used
570  // add energy of the tower and/or flag if theHOIsUsed
571  if(theHOIsUsed) {
572  tower.E += e;
573 
574  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
575  tower.numRecHcalCells += 1;
576  }
577  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
578  tower.numProbHcalCells += 1;
579  }
580  } // HO is used
581 
582 
583  // add HO to constituents even if it is not used: JetMET wants to keep these towers
584  std::pair<DetId,double> mc(detId,e);
585  tower.metaConstituents.push_back(mc);
586 
587  } // not a bad channel, energy above threshold
588 
589  } // HO hit
590 
591  // HF calculates EM fraction differently
592  else if(hcalDetId.subdet() == HcalForward) {
593 
594  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
595  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
596  if (towerDetId.null()) return;
597  MetaTower & tower = find(towerDetId);
598  tower.numBadHcalCells += 1;
599  }
600 
601  else if (energy >= threshold) {
602  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
603  if (towerDetId.null()) return;
604  MetaTower & tower = find(towerDetId);
605 
606  if (hcalDetId.depth() == 1) {
607  // long fiber, so E_EM = E(Long) - E(Short)
608  tower.E_em += e;
609  }
610  else {
611  // short fiber, EHAD = 2 * E(Short)
612  tower.E_em -= e;
613  tower.E_had += 2. * e;
614  }
615  tower.E += e;
616  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
617  tower.numRecHcalCells += 1;
618  }
619  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
620  tower.numProbHcalCells += 1;
621  }
622 
623  // put the timing in HCAL -> have to check timing errors when available
624  // for now use only good channels
625  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
626  tower.hadSumTimeTimesE += ( e * recHit->time() );
627  tower.hadSumEForTime += e;
628  }
629 
630  std::pair<DetId,double> mc(detId,e);
631  tower.metaConstituents.push_back(mc);
632 
633  } // not a bad HF channel, energy above threshold
634 
635  } // HF hit
636 
637  else {
638  // HCAL situation normal in HB/HE
639  if (chStatusForCT == CaloTowersCreationAlgo::BadChan) {
640  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
641  if (towerDetId.null()) return;
642  MetaTower & tower = find(towerDetId);
643  tower.numBadHcalCells += 1;
644  }
645  else if (energy >= threshold) {
646  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(detId);
647  if (towerDetId.null()) return;
648  MetaTower & tower = find(towerDetId);
649  tower.E_had += e;
650  tower.E += e;
651  if (chStatusForCT == CaloTowersCreationAlgo::RecoveredChan) {
652  tower.numRecHcalCells += 1;
653  }
654  else if (chStatusForCT == CaloTowersCreationAlgo::ProblematicChan) {
655  tower.numProbHcalCells += 1;
656  }
657 
658  // Timing information: need specific accessors
659  // for now use only good channels
660  if (chStatusForCT == CaloTowersCreationAlgo::GoodChan) {
661  tower.hadSumTimeTimesE += ( e * recHit->time() );
662  tower.hadSumEForTime += e;
663  }
664  // store energy in highest depth for towers 18-27 (for electron,photon ID in endcap)
665  // also, store energy in HE part of tower 16 (for JetMET cleanup)
666  HcalDetId hcalDetId(detId);
667  if (hcalDetId.subdet()==HcalEndcap) {
668  if ( (hcalDetId.depth()==2 && hcalDetId.ietaAbs()>=18 && hcalDetId.ietaAbs()<27) ||
669  (hcalDetId.depth()==3 && hcalDetId.ietaAbs()==27) ||
670  (hcalDetId.depth()==3 && hcalDetId.ietaAbs()==16) ) {
671  tower.E_outer += e;
672  }
673  }
674 
675  std::pair<DetId,double> mc(detId,e);
676  tower.metaConstituents.push_back(mc);
677 
678  } // not a "bad" channel, energy above threshold
679 
680  } // channel in HBHE (excluding twrs 28,29)
681 
682  }
683 
684  } // recHit normal case (not in HE towers 28,29)
685 
686 } // end of assignHit method
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
const DetId & detid() const
Definition: CaloRecHit.h:21
MetaTower & find(const CaloTowerDetId &id)
looks for a given tower in the internal cache. If it can&#39;t find it, it makes it.
T eta() const
float time() const
Definition: CaloRecHit.h:20
unsigned int ecalChanStatusForCaloTower(const CaloRecHit *hit)
int depth() const
get the tower depth
Definition: HcalDetId.h:42
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:19
const CaloGeometry * theGeometry
int iphi() const
get the tower iphi
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:39
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:36
Definition: DetId.h:20
Detector
Definition: DetId.h:26
bool null() const
is this a null id ?
Definition: DetId.h:47
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 CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
int ieta() const
get the tower ieta
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
const GlobalPoint & getPosition() const
void CaloTowersCreationAlgo::begin ( void  )

Definition at line 248 of file CaloTowersCreationAlgo.cc.

References theTowerMap.

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

248  {
249  theTowerMap.clear();
250  //hcalDropChMap.clear();
251 }
int CaloTowersCreationAlgo::compactTime ( float  time)
private

Definition at line 1353 of file CaloTowersCreationAlgo.cc.

Referenced by convert().

1353  {
1354 
1355  const float timeUnit = 0.01; // discretization (ns)
1356 
1357  if (time> 300.0) return 30000;
1358  if (time< -300.0) return -30000;
1359 
1360  return int(time/timeUnit + 0.5);
1361 
1362 }
void CaloTowersCreationAlgo::convert ( const CaloTowerDetId id,
const MetaTower mt,
CaloTowerCollection collection 
)
private

Definition at line 760 of file CaloTowersCreationAlgo.cc.

References CaloTower::addConstituents(), compactTime(), CaloTowerConstituentsMap::constituentsOf(), edm::contains(), CaloTowersCreationAlgo::MetaTower::E, CaloTowersCreationAlgo::MetaTower::E_em, CaloTowersCreationAlgo::MetaTower::E_had, CaloTowersCreationAlgo::MetaTower::E_outer, DetId::Ecal, EcalBarrel, EcalEndcap, emShwrLogWeightPos(), emShwrPos(), CaloTowersCreationAlgo::MetaTower::emSumEForTime, CaloTowersCreationAlgo::MetaTower::emSumTimeTimesE, reco::LeafCandidate::energy(), PV3DBase< T, PVType, FrameType >::eta(), CaloSubdetectorGeometry::getGeometry(), CaloCellGeometry::getPosition(), hadShwrPos(), CaloTowersCreationAlgo::MetaTower::hadSumEForTime, CaloTowersCreationAlgo::MetaTower::hadSumTimeTimesE, DetId::Hcal, hcalDropChMap, HcalOuter, i, if(), EcalSeverityLevelAlgo::kRecovered, CaloTowersCreationAlgo::MetaTower::metaConstituents, CaloTowersCreationAlgo::MetaTower::numBadHcalCells, CaloTowersCreationAlgo::MetaTower::numProbEcalCells, CaloTowersCreationAlgo::MetaTower::numProbHcalCells, CaloTowersCreationAlgo::MetaTower::numRecEcalCells, CaloTowersCreationAlgo::MetaTower::numRecHcalCells, L1TEmulatorMonitor_cff::p, PV3DBase< T, PVType, FrameType >::phi(), edm::SortedCollection< T, SORT >::push_back(), edm::second(), CaloTower::setCaloTowerStatus(), CaloTower::setEcalTime(), CaloTower::setHcalTime(), CaloTower::setHottestCellE(), EcalSeverityLevelAlgo::severityLevel(), HcalDetId::subdet(), theEbHandle, theEBSumThreshold, theEcalAcceptSeverityLevel, theEcalSevLvlAlgo, theEcutTower, theEeHandle, theEESumThreshold, theHcalThreshold, theHOIsUsed, theMomConstrMethod, theMomEBDepth, theMomEEDepth, theMomHBDepth, theMomHEDepth, theRecoveredEcalHitsAreUsed, theTowerConstituentsMap, and theTowerGeometry.

Referenced by finish().

762 {
763  double ecalThres=(id.ietaAbs()<=17)?(theEBSumThreshold):(theEESumThreshold);
764  double E=mt.E;
765  double E_em=mt.E_em;
766  double E_had=mt.E_had;
767  double E_outer=mt.E_outer;
768 
769  // Note: E_outer is used to save HO energy OR energy in the outermost depths in endcap region
770  // In the methods with separate treatment of EM and HAD components:
771  // - HO is not used to determine direction, however HO energy is added to get "total had energy"
772  // => Check if the tower is within HO coverage before adding E_outer to the "total had" energy
773  // else the energy will be double counted
774  // When summing up the energy of the tower these checks are performed in the loops over RecHits
775 
776  std::vector<std::pair<DetId,double> > metaContains=mt.metaConstituents;
777  if (id.ietaAbs()<=29 && E_em<ecalThres) { // ignore EM threshold in HF
778  E-=E_em;
779  E_em=0;
780  std::vector<std::pair<DetId,double> > metaContains_noecal;
781 
782  for (std::vector<std::pair<DetId,double> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i)
783  if (i->first.det()!=DetId::Ecal) metaContains_noecal.push_back(*i);
784  metaContains.swap(metaContains_noecal);
785  }
786  if (id.ietaAbs()<=29 && E_had<theHcalThreshold) {
787  E-=E_had;
788 
789  if (theHOIsUsed && id.ietaAbs()<16) E-=E_outer; // not subtracted before, think it should be done
790 
791  E_had=0;
792  E_outer=0;
793  std::vector<std::pair<DetId,double> > metaContains_nohcal;
794 
795  for (std::vector<std::pair<DetId,double> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i)
796  if (i->first.det()!=DetId::Hcal) metaContains_nohcal.push_back(*i);
797  metaContains.swap(metaContains_nohcal);
798  }
799 
800  if(metaContains.empty()) return;
801 
802  double E_had_tot = (theHOIsUsed && id.ietaAbs()<16)? E_had+E_outer : E_had;
803 
804 
805  // create CaloTower using the selected algorithm
806 
807  GlobalPoint emPoint, hadPoint;
808 
810 
811 
812  // conditional assignment of depths for barrel/endcap
813  // Some additional tuning may be required in the transitional region
814  // 14<|iEta|<19
815  double momEmDepth = 0.;
816  double momHadDepth = 0.;
817  if (id.ietaAbs()<=17) {
818  momHadDepth = theMomHBDepth;
819  momEmDepth = theMomEBDepth;
820  }
821  else {
822  momHadDepth = theMomHEDepth;
823  momEmDepth = theMomEEDepth;
824  }
825 
826  switch (theMomConstrMethod) {
827 
828  case 0 :
829  { // Simple 4-momentum assignment
831 
832  double pf=1.0/cosh(p.eta());
833  if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0);
834 
835  emPoint = p;
836  hadPoint = p;
837  } // end case 0
838  break;
839 
840  case 1 :
841  { // separate 4-vectors for ECAL, HCAL, add to get the 4-vector of the tower (=>tower has mass!)
842  if (id.ietaAbs()<=29) {
843  if (E_em>0) {
844  emPoint = emShwrPos(metaContains, momEmDepth, E_em);
845  double emPf = 1.0/cosh(emPoint.eta());
846  towerP4 += CaloTower::PolarLorentzVector(E_em*emPf, emPoint.eta(), emPoint.phi(), 0);
847  }
848  if ( (E_had + E_outer) >0) {
849  hadPoint = hadShwrPos(id, momHadDepth);
850  double hadPf = 1.0/cosh(hadPoint.eta());
851 
852  if (E_had_tot>0) {
853  towerP4 += CaloTower::PolarLorentzVector(E_had_tot*hadPf, hadPoint.eta(), hadPoint.phi(), 0);
854  }
855  }
856  }
857  else { // forward detector: use the CaloTower position
859  double pf=1.0/cosh(p.eta());
860  if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
861  emPoint = p;
862  hadPoint = p;
863  }
864  } // end case 1
865  break;
866 
867  case 2:
868  { // use ECAL position for the tower (when E_cal>0), else default CaloTower position (massless tower)
869  if (id.ietaAbs()<=29) {
870  if (E_em>0) emPoint = emShwrLogWeightPos(metaContains, momEmDepth, E_em);
871  else emPoint = theTowerGeometry->getGeometry(id)->getPosition();
872 
873  double sumPf = 1.0/cosh(emPoint.eta());
874  if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*sumPf, emPoint.eta(), emPoint.phi(), 0);
875 
876  hadPoint = emPoint;
877  }
878  else { // forward detector: use the CaloTower position
880  double pf=1.0/cosh(p.eta());
881  if (E>0) towerP4 = CaloTower::PolarLorentzVector(E*pf, p.eta(), p.phi(), 0); // simple momentum assignment, same position
882  emPoint = p;
883  hadPoint = p;
884  }
885  } // end case 2
886  break;
887 
888  } // end of decision on p4 reconstruction method
889 
890 
891  CaloTower caloTower(id, E_em, E_had, E_outer, -1, -1, towerP4, emPoint, hadPoint);
892  if(caloTower.energy() < theEcutTower) return;
893  // set the timings
894  float ecalTime = (mt.emSumEForTime>0)? mt.emSumTimeTimesE/mt.emSumEForTime : -9999;
895  float hcalTime = (mt.hadSumEForTime>0)? mt.hadSumTimeTimesE/mt.hadSumEForTime : -9999;
896  caloTower.setEcalTime(compactTime(ecalTime));
897  caloTower.setHcalTime(compactTime(hcalTime));
898 
899  // set the CaloTower status word =====================================
900  // Channels must be counter exclusively in the defined cathegories
901  // "Bad" channels (not used in energy assignment) can be flagged during
902  // CaloTower creation only if specified in the configuration file
903 
904  unsigned int numBadHcalChan = mt.numBadHcalCells;
905  // unsigned int numBadEcalChan = mt.numBadEcalCells;
906  unsigned int numBadEcalChan = 0; //
907 
908  unsigned int numRecHcalChan = mt.numRecHcalCells;
909  unsigned int numRecEcalChan = mt.numRecEcalCells;
910  unsigned int numProbHcalChan = mt.numProbHcalCells;
911  unsigned int numProbEcalChan = mt.numProbEcalCells;
912 
913  // now add dead/off/... channels not used in RecHit reconstruction for HCAL
914  HcalDropChMap::iterator dropChItr = hcalDropChMap.find(id);
915  if (dropChItr != hcalDropChMap.end()) numBadHcalChan += dropChItr->second;
916 
917 
918  // for ECAL the number of all bad channels is obtained here -----------------------
919 
920  // get all possible constituents of the tower
921  std::vector<DetId> allConstituents = theTowerConstituentsMap->constituentsOf(id);
922 
923  for (std::vector<DetId>::iterator ac_it=allConstituents.begin();
924  ac_it!=allConstituents.end(); ++ac_it) {
925 
926  if (ac_it->det()!=DetId::Ecal) continue;
927 
928  int thisEcalSevLvl = -999;
929 
930  if (ac_it->subdetId() == EcalBarrel && theEbHandle.isValid()) {
931  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEbHandle);//, *theEcalChStatus);
932  }
933  else if (ac_it->subdetId() == EcalEndcap && theEeHandle.isValid()) {
934  thisEcalSevLvl = theEcalSevLvlAlgo->severityLevel( *ac_it, *theEeHandle);//, *theEcalChStatus);
935  }
936 
937  // "bad" include "recovered" if the flag not to use them was set
938  // this is consistent with the treatment of what channels are accepted
939  if (thisEcalSevLvl>int(theEcalAcceptSeverityLevel) ||
941 
942  ++numBadEcalChan;
943  }
944 
945  }
946  //--------------------------------------------------------------------------------------
947 
948  caloTower.setCaloTowerStatus(numBadHcalChan, numBadEcalChan,
949  numRecHcalChan, numRecEcalChan,
950  numProbHcalChan, numProbEcalChan);
951 
952  double maxCellE = -999.0; // for storing the hottest cell E in the calotower
953 
954  std::vector<DetId> contains;
955  contains.reserve(metaContains.size());
956  for (std::vector<std::pair<DetId,double> >::iterator i=metaContains.begin(); i!=metaContains.end(); ++i) {
957 
958  contains.push_back(i->first);
959 
960  if (maxCellE < i->second) {
961  // need an extra check because of the funny towers that are empty except for the presence of an HO
962  // hit in the constituents (JetMET wanted them saved)
963  // This constituent is only used for storing the tower, but should not be concidered as a hot cell canditate for
964  // configurations with useHO = false
965 
966 
967  if (i->first.det()==DetId::Ecal) { // ECAL
968  maxCellE = i->second;
969  }
970  else { // HCAL
971  if (HcalDetId(i->first).subdet() != HcalOuter)
972  maxCellE = i->second;
973  else if (theHOIsUsed) maxCellE = i->second;
974  }
975 
976  } // found higher E cell
977 
978  } // loop over matacontains
979 
980  caloTower.addConstituents(contains);
981  caloTower.setHottestCellE(maxCellE);
982 
983  collection.push_back(caloTower);
984 }
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:32
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:27
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
void push_back(T const &t)
edm::Handle< EcalRecHitCollection > theEeHandle
GlobalPoint emShwrPos(const std::vector< std::pair< DetId, double > > &metaContains, float fracDepth, double totEmE)
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
U second(std::pair< T, U > const &p)
const CaloSubdetectorGeometry * theTowerGeometry
EcalSeverityLevel severityLevel(const DetId &id, const EcalRecHitCollection &rhs) const
Evaluate status from id.
const CaloTowerConstituentsMap * theTowerConstituentsMap
bool theHOIsUsed
only affects energy and ET calculation. HO is still recorded in the tower
T eta() const
Definition: PV3DBase.h:70
GlobalPoint hadShwrPos(const std::vector< std::pair< DetId, double > > &metaContains, float fracDepth, double hadE)
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
perl if(1 lt scalar(@::datatypes))
Definition: edlooper.cc:31
const GlobalPoint & getPosition() const
edm::Handle< EcalRecHitCollection > theEbHandle
GlobalPoint emShwrLogWeightPos(const std::vector< std::pair< DetId, double > > &metaContains, float fracDepth, double totEmE)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:41
unsigned int CaloTowersCreationAlgo::ecalChanStatusForCaloTower ( const CaloRecHit hit)

Definition at line 1472 of file CaloTowersCreationAlgo.cc.

References BadChan, GoodChan, IgnoredChan, EcalSeverityLevelAlgo::kGood, EcalSeverityLevelAlgo::kRecovered, ProblematicChan, RecoveredChan, EcalSeverityLevelAlgo::severityLevel(), theEcalAcceptSeverityLevel, theEcalAcceptSeverityLevelForRejectedHit, theEcalSevLvlAlgo, theRecoveredEcalHitsAreUsed, useRejectedHitsOnly, and useRejectedRecoveredEcalHits.

Referenced by assignHit().

1472  {
1473 
1474  // const DetId id = hit->detid();
1475 
1476  // uint16_t dbStatus = theEcalChStatus->find(id)->getStatusCode();
1477  // uint32_t rhFlags = hit->flags();
1478  // int severityLevel = theEcalSevLvlAlgo->severityLevel(rhFlags, dbStatus);
1479  // The methods above will become private and cannot be usef for flagging ecal spikes.
1480  // Use the recommended interface - we leave the parameters for spilke removal to be specified by ECAL.
1481 
1482 
1483  // int severityLevel = 999;
1484 
1485  EcalRecHit const & rh = *reinterpret_cast<EcalRecHit const *>(hit);
1486  int severityLevel = theEcalSevLvlAlgo->severityLevel(rh);
1487 
1488 // if (id.subdetId() == EcalBarrel) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEbHandle);//, *theEcalChStatus);
1489 // else if (id.subdetId() == EcalEndcap) severityLevel = theEcalSevLvlAlgo->severityLevel( id, *theEeHandle);//, *theEcalChStatus);
1490 
1491  // there should be no other ECAL types used in this reconstruction
1492 
1493  // The definition of ECAL severity levels uses categories that
1494  // are similar to the defined for CaloTower. (However, the categorization
1495  // for CaloTowers depends on the specified maximum acceptabel severity and therefore cannnot
1496  // be exact correspondence between the two. ECAL has additional categories describing modes of failure.)
1497  // This approach is different from the initial idea and from
1498  // the implementation for HCAL. Still make the logic similar to HCAL so that one has the ability to
1499  // exclude problematic channels as defined by ECAL.
1500  // For definitions of ECAL severity levels see RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h
1501 
1502 
1503  bool isRecovered = (severityLevel == EcalSeverityLevelAlgo::kRecovered);
1504 
1505 
1506  // for use with rejected by the regular reconstruction hits
1507  if (useRejectedHitsOnly) {
1508 
1509  if (!isRecovered) {
1510  if (severityLevel <= int(theEcalAcceptSeverityLevel) ||
1512  // this hit was either accepted already, or counted as bad under the conditions
1513  }
1514  else {
1515 
1517  // skip recovered hits either because they were already used or because there was an explicit instruction
1519  }
1520  else if (useRejectedRecoveredEcalHits) {
1522  }
1523 
1524  } // recovered channels
1525 
1526  // clasify channels as problematic
1528 
1529  } // treatment of rejected hits
1530 
1531 
1532 
1533 
1534 
1535  // for normal reconstruction
1537 
1538  if (isRecovered) {
1539  return (theRecoveredEcalHitsAreUsed) ?
1541  }
1542  else {
1543  if (severityLevel > int(theEcalAcceptSeverityLevel)) {
1545  }
1546  else {
1548  }
1549  }
1550 
1551 
1552 }
unsigned int theEcalAcceptSeverityLevelForRejectedHit
EcalSeverityLevel severityLevel(const DetId &id, const EcalRecHitCollection &rhs) const
Evaluate status from id.
const EcalSeverityLevelAlgo * theEcalSevLvlAlgo
GlobalPoint CaloTowersCreationAlgo::emCrystalShwrPos ( DetId  detId,
float  fracDepth 
)

Definition at line 1127 of file CaloTowersCreationAlgo.cc.

References CaloCellGeometry::getCorners(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), point, theGeometry, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by emShwrLogWeightPos(), and emShwrPos().

1127  {
1128  const CaloCellGeometry* cellGeometry = theGeometry->getGeometry(detId);
1129  GlobalPoint point = cellGeometry->getPosition(); // face of the cell
1130 
1131  if (fracDepth<0) fracDepth=0;
1132  else if (fracDepth>1) fracDepth=1;
1133 
1134  if (fracDepth>0.0) {
1135  CaloCellGeometry::CornersVec cv = cellGeometry->getCorners();
1136  GlobalPoint backPoint = GlobalPoint( 0.25*( cv[4].x() + cv[5].x() + cv[6].x() + cv[7].x() ),
1137  0.25*( cv[4].y() + cv[5].y() + cv[6].y() + cv[7].y() ),
1138  0.25*( cv[4].z() + cv[5].z() + cv[6].z() + cv[7].z() ) );
1139  point += fracDepth * (backPoint-point);
1140  }
1141 
1142  return point;
1143 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double double double z
const CaloGeometry * theGeometry
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
Definition: DDAxes.h:10
const GlobalPoint & getPosition() 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
virtual const CornersVec & getCorners() const =0
GlobalPoint CaloTowersCreationAlgo::emShwrLogWeightPos ( const std::vector< std::pair< DetId, double > > &  metaContains,
float  fracDepth,
double  totEmE 
)

Definition at line 1314 of file CaloTowersCreationAlgo.cc.

References DetId::Ecal, emCrystalShwrPos(), funct::log(), L1TEmulatorMonitor_cff::p, CommonMethods::weight(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by convert().

1315  {
1316 
1317  double emX = 0.0;
1318  double emY = 0.0;
1319  double emZ = 0.0;
1320 
1321  double weight = 0;
1322  double sumWeights = 0;
1323  double sumEmE = 0; // add crystals with E/E_EM > 1.5%
1324  double crystalThresh = 0.015 * emE;
1325 
1326  std::vector<std::pair<DetId,double> >::const_iterator mc_it = metaContains.begin();
1327  for (; mc_it!=metaContains.end(); ++mc_it) {
1328  if (mc_it->second < 0) continue;
1329  if (mc_it->first.det() == DetId::Ecal && mc_it->second > crystalThresh) sumEmE += mc_it->second;
1330  }
1331 
1332  for (mc_it = metaContains.begin(); mc_it!=metaContains.end(); ++mc_it) {
1333 
1334  if (mc_it->first.det() != DetId::Ecal || mc_it->second < crystalThresh) continue;
1335 
1336  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1337 
1338  weight = 4.2 + log(mc_it->second/sumEmE);
1339  sumWeights += weight;
1340 
1341  emX += p.x() * weight;
1342  emY += p.y() * weight;
1343  emZ += p.z() * weight;
1344  }
1345 
1346  return GlobalPoint(emX/sumWeights, emY/sumWeights, emZ/sumWeights);
1347 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:57
T z() const
Definition: PV3DBase.h:58
Log< T >::type log(const T &t)
Definition: Log.h:22
T x() const
Definition: PV3DBase.h:56
GlobalPoint CaloTowersCreationAlgo::emShwrPos ( const std::vector< std::pair< DetId, double > > &  metaContains,
float  fracDepth,
double  totEmE 
)

Definition at line 1284 of file CaloTowersCreationAlgo.cc.

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

Referenced by convert().

1285  {
1286 
1287  if (emE<=0) return GlobalPoint(0,0,0);
1288 
1289  double emX = 0.0;
1290  double emY = 0.0;
1291  double emZ = 0.0;
1292 
1293  double eSum = 0;
1294 
1295  std::vector<std::pair<DetId,double> >::const_iterator mc_it = metaContains.begin();
1296  for (; mc_it!=metaContains.end(); ++mc_it) {
1297  if (mc_it->first.det() != DetId::Ecal) continue;
1298  GlobalPoint p = emCrystalShwrPos(mc_it->first, fracDepth);
1299  double e = mc_it->second;
1300 
1301  if (e>0) {
1302  emX += p.x() * e;
1303  emY += p.y() * e;
1304  emZ += p.z() * e;
1305  eSum += e;
1306  }
1307 
1308  }
1309 
1310  return GlobalPoint(emX/eSum, emY/eSum, emZ/eSum);
1311 }
GlobalPoint emCrystalShwrPos(DetId detId, float fracDepth)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:57
T z() const
Definition: PV3DBase.h:58
T x() const
Definition: PV3DBase.h:56
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 744 of file CaloTowersCreationAlgo.cc.

References theTowerMap.

Referenced by assignHit(), and rescale().

744  {
745  MetaTowerMap::iterator itr = theTowerMap.lower_bound(detId);
746  if(itr != theTowerMap.end() && ! (theTowerMap.key_comp()(detId,itr->first)))
747  {
748  // do nothing if exists
749  }
750  else
751  {
752  // build and insert a new tower
753  // and return position
754  itr = theTowerMap.insert(itr, std::pair<CaloTowerDetId,CaloTowersCreationAlgo::MetaTower>(detId, MetaTower()));
755  }
756  return itr->second;
757 }
void CaloTowersCreationAlgo::finish ( CaloTowerCollection destCollection)

Definition at line 290 of file CaloTowersCreationAlgo.cc.

References convert(), and theTowerMap.

Referenced by CaloTowersCreator::produce().

290  {
291  // now copy this map into the final collection
292  for(MetaTowerMap::const_iterator mapItr = theTowerMap.begin();
293  mapItr != theTowerMap.end(); ++mapItr) {
294 
295  // Convert only if there is at least one constituent in the metatower.
296  // The check of constituents size in the coverted tower is still needed!
297  if ( (mapItr->second).metaConstituents.empty() ) continue;
298  convert(mapItr->first, mapItr->second, result);
299  }
300  theTowerMap.clear(); // save the memory
301 }
tuple result
Definition: query.py:137
void convert(const CaloTowerDetId &id, const MetaTower &mt, CaloTowerCollection &collection)
void CaloTowersCreationAlgo::getThresholdAndWeight ( const DetId detId,
double &  threshold,
double &  weight 
) const
private

helper method to look up the appropriate threshold & weight

Definition at line 988 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 assignHit(), rescale(), and rescaleTowers().

988  {
989  DetId::Detector det = detId.det();
990  weight=0; // in case the hit is not identified
991 
992  if(det == DetId::Ecal) {
993  // may or may not be EB. We'll find out.
994 
995  EcalSubdetector subdet = (EcalSubdetector)(detId.subdetId());
996  if(subdet == EcalBarrel) {
999  if (weight <= 0.) {
1000  ROOT::Math::Interpolator my(theEBGrid,theEBWeights,ROOT::Math::Interpolation::kAKIMA);
1001  weight = my.Eval(theEBEScale);
1002  }
1003  }
1004  else if(subdet == EcalEndcap) {
1006  weight = theEEweight;
1007  if (weight <= 0.) {
1008  ROOT::Math::Interpolator my(theEEGrid,theEEWeights,ROOT::Math::Interpolation::kAKIMA);
1009  weight = my.Eval(theEEEScale);
1010  }
1011  }
1012  }
1013  else if(det == DetId::Hcal) {
1014  HcalDetId hcalDetId(detId);
1015  HcalSubdetector subdet = hcalDetId.subdet();
1016 
1017  if(subdet == HcalBarrel) {
1019  weight = theHBweight;
1020  if (weight <= 0.) {
1021  ROOT::Math::Interpolator my(theHBGrid,theHBWeights,ROOT::Math::Interpolation::kAKIMA);
1022  weight = my.Eval(theHBEScale);
1023  }
1024  }
1025 
1026  else if(subdet == HcalEndcap) {
1027  // check if it's single or double tower
1028  if(hcalDetId.ietaAbs() < theHcalTopology->firstHEDoublePhiRing()) {
1030  weight = theHESweight;
1031  if (weight <= 0.) {
1032  ROOT::Math::Interpolator my(theHESGrid,theHESWeights,ROOT::Math::Interpolation::kAKIMA);
1033  weight = my.Eval(theHESEScale);
1034  }
1035  }
1036  else {
1038  weight = theHEDweight;
1039  if (weight <= 0.) {
1040  ROOT::Math::Interpolator my(theHEDGrid,theHEDWeights,ROOT::Math::Interpolation::kAKIMA);
1041  weight = my.Eval(theHEDEScale);
1042  }
1043  }
1044  }
1045 
1046  else if(subdet == HcalOuter) {
1047  //check if it's ring 0 or +1 or +2 or -1 or -2
1048  if(hcalDetId.ietaAbs() <= 4) threshold = theHOthreshold0;
1049  else if(hcalDetId.ieta() < 0) {
1050  // set threshold for ring -1 or -2
1051  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdMinus1 : theHOthresholdMinus2;
1052  } else {
1053  // set threshold for ring +1 or +2
1054  threshold = (hcalDetId.ietaAbs() <= 10) ? theHOthresholdPlus1 : theHOthresholdPlus2;
1055  }
1056  weight = theHOweight;
1057  if (weight <= 0.) {
1058  ROOT::Math::Interpolator my(theHOGrid,theHOWeights,ROOT::Math::Interpolation::kAKIMA);
1059  weight = my.Eval(theHOEScale);
1060  }
1061  }
1062 
1063  else if(subdet == HcalForward) {
1064  if(hcalDetId.depth() == 1) {
1066  weight = theHF1weight;
1067  if (weight <= 0.) {
1068  ROOT::Math::Interpolator my(theHF1Grid,theHF1Weights,ROOT::Math::Interpolation::kAKIMA);
1069  weight = my.Eval(theHF1EScale);
1070  }
1071  } else {
1073  weight = theHF2weight;
1074  if (weight <= 0.) {
1075  ROOT::Math::Interpolator my(theHF2Grid,theHF2Weights,ROOT::Math::Interpolation::kAKIMA);
1076  weight = my.Eval(theHF2EScale);
1077  }
1078  }
1079  }
1080  }
1081  else {
1082  edm::LogError("CaloTowersCreationAlgo") << "Bad cell: " << det << std::endl;
1083  }
1084 }
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:32
std::vector< double > theHOGrid
std::vector< double > theHF1Weights
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:70
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
std::vector< double > theHBWeights
Detector
Definition: DetId.h:26
const HcalTopology * theHcalTopology
std::vector< double > theHF1Grid
std::vector< double > theEBGrid
std::vector< double > theHF2Weights
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
EcalSubdetector
std::vector< double > theEBWeights
GlobalPoint CaloTowersCreationAlgo::hadSegmentShwrPos ( DetId  detId,
float  fracDepth 
)

Definition at line 1145 of file CaloTowersCreationAlgo.cc.

References CaloCellGeometry::getCorners(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), point, theGeometry, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by hadShwrPos().

1145  {
1146  const CaloCellGeometry* cellGeometry = theGeometry->getGeometry(detId);
1147  GlobalPoint point = cellGeometry->getPosition(); // face of the cell
1148 
1149  if (fracDepth<0) fracDepth=0;
1150  else if (fracDepth>1) fracDepth=1;
1151 
1152  if (fracDepth>0.0) {
1153  CaloCellGeometry::CornersVec cv = cellGeometry->getCorners();
1154  GlobalPoint backPoint = GlobalPoint( 0.25*( cv[4].x() + cv[5].x() + cv[6].x() + cv[7].x() ),
1155  0.25*( cv[4].y() + cv[5].y() + cv[6].y() + cv[7].y() ),
1156  0.25*( cv[4].z() + cv[5].z() + cv[6].z() + cv[7].z() ) );
1157  point += fracDepth * (backPoint-point);
1158  }
1159 
1160  return point;
1161 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double double double z
const CaloGeometry * theGeometry
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
Definition: DDAxes.h:10
const GlobalPoint & getPosition() 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
virtual const CornersVec & getCorners() const =0
GlobalPoint CaloTowersCreationAlgo::hadShwPosFromCells ( DetId  frontCell,
DetId  backCell,
float  fracDepth 
)

Definition at line 1262 of file CaloTowersCreationAlgo.cc.

References CaloCellGeometry::getCorners(), CaloGeometry::getGeometry(), CaloCellGeometry::getPosition(), point, theGeometry, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by hadShwrPos().

1262  {
1263 
1264  // uses the "front" and "back" cells
1265  // to determine the axis. point set by the predefined depth.
1266 
1267  const CaloCellGeometry* frontCellGeometry = theGeometry->getGeometry(DetId(frontCellId));
1268  const CaloCellGeometry* backCellGeometry = theGeometry->getGeometry(DetId(backCellId));
1269 
1270  GlobalPoint point = frontCellGeometry->getPosition();
1271 
1272  CaloCellGeometry::CornersVec cv = backCellGeometry->getCorners();
1273 
1274  GlobalPoint backPoint = GlobalPoint(0.25 * (cv[4].x() + cv[5].x() + cv[6].x() + cv[7].x()),
1275  0.25 * (cv[4].y() + cv[5].y() + cv[6].y() + cv[7].y()),
1276  0.25 * (cv[4].z() + cv[5].z() + cv[6].z() + cv[7].z()));
1277 
1278  point += fracDepth * (backPoint - point);
1279 
1280  return point;
1281 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
double double double z
const CaloGeometry * theGeometry
Definition: DetId.h:20
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:76
Definition: DDAxes.h:10
const GlobalPoint & getPosition() 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
virtual const CornersVec & getCorners() const =0
GlobalPoint CaloTowersCreationAlgo::hadShwrPos ( const std::vector< std::pair< DetId, double > > &  metaContains,
float  fracDepth,
double  hadE 
)

Definition at line 1164 of file CaloTowersCreationAlgo.cc.

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

Referenced by convert().

1165  {
1166 
1167  // this is based on available RecHits, can lead to different actual depths if
1168  // hits in multi-depth towers are not all there
1169  if (hadE<=0) return GlobalPoint(0,0,0);
1170 
1171  double hadX = 0.0;
1172  double hadY = 0.0;
1173  double hadZ = 0.0;
1174 
1175  int nConst = 0;
1176 
1177  std::vector<std::pair<DetId,double> >::const_iterator mc_it = metaContains.begin();
1178  for (; mc_it!=metaContains.end(); ++mc_it) {
1179  if (mc_it->first.det() != DetId::Hcal) continue;
1180  // do not use HO for deirection calculations for now
1181  if (HcalDetId(mc_it->first).subdet() == HcalOuter) continue;
1182  ++nConst;
1183 
1184  GlobalPoint p = hadSegmentShwrPos(mc_it->first, fracDepth);
1185 
1186  // longitudinal segmentation: do not weight by energy,
1187  // get the geometrical position
1188  hadX += p.x();
1189  hadY += p.y();
1190  hadZ += p.z();
1191  }
1192 
1193  return GlobalPoint(hadX/nConst, hadY/nConst, hadZ/nConst);
1194 }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:57
T z() const
Definition: PV3DBase.h:58
GlobalPoint hadSegmentShwrPos(DetId detId, float fracDepth)
T x() const
Definition: PV3DBase.h:56
GlobalPoint CaloTowersCreationAlgo::hadShwrPos ( CaloTowerDetId  id,
float  fracDepth 
)

Definition at line 1197 of file CaloTowersCreationAlgo.cc.

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

1197  {
1198 
1199  // set depth using geometry of cells that are associated with the
1200  // tower (regardless if they have non-zero energies)
1201 
1202 // if (hadE <= 0) return GlobalPoint(0, 0, 0);
1203 
1204  if (fracDepth < 0) fracDepth = 0;
1205  else if (fracDepth > 1) fracDepth = 1;
1206 
1207  GlobalPoint point(0,0,0);
1208 
1209  int iEta = towerId.ieta();
1210  int iPhi = towerId.iphi();
1211 
1212  HcalDetId frontCellId, backCellId;
1213 
1214  if (towerId.ietaAbs() <= 14) {
1215  // barrel, one depth only
1216  frontCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1217  backCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1218  }
1219  else if (towerId.ietaAbs() == 15) {
1220  // barrel, two depths
1221  frontCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1222  backCellId = HcalDetId(HcalBarrel, iEta, iPhi, 2);
1223  }
1224  else if (towerId.ietaAbs() == 16) {
1225  // barrel and endcap: two depths HB, one depth HE
1226  frontCellId = HcalDetId(HcalBarrel, iEta, iPhi, 1);
1227  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 3); // this cell is in endcap!
1228  }
1229  else if (towerId.ietaAbs() == 17) {
1230  // endcap, one depth only
1231  frontCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1232  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1233  }
1234  else if (towerId.ietaAbs() >= 18 && towerId.ietaAbs() <= 26) {
1235  // endcap: two depths
1236  frontCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1237  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 2);
1238  }
1239  else if (towerId.ietaAbs() <= 29) {
1240  // endcap: three depths
1241  frontCellId = HcalDetId(HcalEndcap, iEta, iPhi, 1);
1242  // there is no iEta=29 for depth 3
1243  if (iEta == 29) iEta = 28;
1244  if (iEta == -29) iEta = -28;
1245  backCellId = HcalDetId(HcalEndcap, iEta, iPhi, 3);
1246  }
1247  else if (towerId.ietaAbs() >= 30) {
1248  // forward, take the goemetry for long fibers
1249  frontCellId = HcalDetId(HcalForward, iEta, iPhi, 1);
1250  backCellId = HcalDetId(HcalForward, iEta, iPhi, 1);
1251  }
1252  else {
1253  // should not get here
1254  return point;
1255  }
1256 
1257  point = hadShwPosFromCells(DetId(frontCellId), DetId(backCellId), fracDepth);
1258 
1259  return point;
1260 }
Definition: DetId.h:20
GlobalPoint hadShwPosFromCells(DetId frontCell, DetId backCell, float fracDepth)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
unsigned int CaloTowersCreationAlgo::hcalChanStatusForCaloTower ( const CaloRecHit hit)

Definition at line 1411 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 assignHit().

1411  {
1412 
1413  const DetId id = hit->detid();
1414 
1415  const uint32_t recHitFlag = hit->flags();
1416  const uint32_t dbStatusFlag = theHcalChStatus->getValues(id)->getValue();
1417 
1418  int severityLevel = theHcalSevLvlComputer->getSeverityLevel(id, recHitFlag, dbStatusFlag);
1419  bool isRecovered = theHcalSevLvlComputer->recoveredRecHit(id, recHitFlag);
1420 
1421 
1422  // For use with hits rejected in the default reconstruction
1423  if (useRejectedHitsOnly) {
1424 
1425  if (!isRecovered) {
1426  if (severityLevel <= int(theHcalAcceptSeverityLevel) ||
1428  // this hit was either already accepted or is worse than
1429  }
1430  else {
1431 
1433  // skip recovered hits either because they were already used or because there was an explicit instruction
1435  }
1436  else if (useRejectedRecoveredHcalHits) {
1438  }
1439 
1440  } // recovered channels
1441 
1442  // clasify channels as problematic: no good hits are supposed to be present in the
1443  // extra rechit collections
1445 
1446  } // treatment of rejected hits
1447 
1448 
1449 
1450 
1451  // this is for the regular reconstruction sequence
1452 
1453  if (severityLevel == 0) return CaloTowersCreationAlgo::GoodChan;
1454 
1455  if (isRecovered) {
1456  return (theRecoveredHcalHitsAreUsed) ?
1458  }
1459  else {
1460  if (severityLevel > int(theHcalAcceptSeverityLevel)) {
1462  }
1463  else {
1465  }
1466  }
1467 
1468 }
const HcalChannelQuality * theHcalChStatus
const DetId & detid() const
Definition: CaloRecHit.h:21
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
uint32_t flags() const
Definition: CaloRecHit.h:22
const HcalSeverityLevelComputer * theHcalSevLvlComputer
Definition: DetId.h:20
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
uint32_t getValue() const
unsigned int theHcalAcceptSeverityLevelForRejectedHit
const Item * getValues(DetId fId) const
void CaloTowersCreationAlgo::makeHcalDropChMap ( )

Definition at line 1373 of file CaloTowersCreationAlgo.cc.

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

Referenced by CaloTowersCreator::produce().

1373  {
1374 
1375  // This method fills the map of number of dead channels for the calotower,
1376  // The key of the map is CaloTowerDetId.
1377  // By definition these channels are not going to be in the RecHit collections.
1378  hcalDropChMap.clear();
1379  std::vector<DetId> allChanInStatusCont = theHcalChStatus->getAllChannels();
1380 
1381  for (std::vector<DetId>::iterator it = allChanInStatusCont.begin(); it!=allChanInStatusCont.end(); ++it) {
1382 
1383  const uint32_t dbStatusFlag = theHcalChStatus->getValues(*it)->getValue();
1384 
1385  if (theHcalSevLvlComputer->dropChannel(dbStatusFlag)) {
1386 
1388 
1389  hcalDropChMap[twrId] +=1;
1390 
1391  // special case for tower 29: if HCAL hit is in depth 3 add to twr 29 as well
1392  if (HcalDetId(*it).subdet()==HcalEndcap &&
1393  HcalDetId(*it).depth()==3 &&
1394  HcalDetId(*it).ietaAbs()==28) {
1395 
1396  CaloTowerDetId twrId29(twrId.ieta()+twrId.zside(), twrId.iphi());
1397  hcalDropChMap[twrId29] +=1;
1398  }
1399 
1400  }
1401 
1402  }
1403 
1404  return;
1405 }
const HcalChannelQuality * theHcalChStatus
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:32
int depth() const
get the tower depth
Definition: HcalDetId.h:42
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
std::vector< DetId > getAllChannels() const
int iphi() const
get the tower iphi
bool dropChannel(const uint32_t &mystatus) const
const CaloTowerConstituentsMap * theTowerConstituentsMap
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:36
const HcalSeverityLevelComputer * theHcalSevLvlComputer
int zside() const
get the z-side of the tower (1/-1)
int ieta() const
get the tower ieta
uint32_t getValue() const
const Item * getValues(DetId fId) const
void CaloTowersCreationAlgo::process ( const HBHERecHitCollection hbhe)

Definition at line 253 of file CaloTowersCreationAlgo.cc.

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

Referenced by CaloTowersCreator::produce().

253  {
254  for(HBHERecHitCollection::const_iterator hbheItr = hbhe.begin();
255  hbheItr != hbhe.end(); ++hbheItr)
256  assignHit(&(*hbheItr));
257 }
std::vector< T >::const_iterator const_iterator
const_iterator end() const
void assignHit(const CaloRecHit *recHit)
adds a single hit to the tower
const_iterator begin() const
void CaloTowersCreationAlgo::process ( const HORecHitCollection ho)

Definition at line 259 of file CaloTowersCreationAlgo.cc.

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

259  {
260  for(HORecHitCollection::const_iterator hoItr = ho.begin();
261  hoItr != ho.end(); ++hoItr)
262  assignHit(&(*hoItr));
263 }
std::vector< T >::const_iterator const_iterator
const_iterator end() const
void assignHit(const CaloRecHit *recHit)
adds a single hit to the tower
const_iterator begin() const
void CaloTowersCreationAlgo::process ( const HFRecHitCollection hf)

Definition at line 265 of file CaloTowersCreationAlgo.cc.

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

265  {
266  for(HFRecHitCollection::const_iterator hfItr = hf.begin();
267  hfItr != hf.end(); ++hfItr)
268  assignHit(&(*hfItr));
269 }
std::vector< T >::const_iterator const_iterator
const_iterator end() const
void assignHit(const CaloRecHit *recHit)
adds a single hit to the tower
const_iterator begin() const
void CaloTowersCreationAlgo::process ( const EcalRecHitCollection ecal)

Definition at line 271 of file CaloTowersCreationAlgo.cc.

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

271  {
272  for(EcalRecHitCollection::const_iterator ecItr = ec.begin();
273  ecItr != ec.end(); ++ecItr)
274  assignHit(&(*ecItr));
275 }
std::vector< T >::const_iterator const_iterator
void assignHit(const CaloRecHit *recHit)
adds a single hit to the tower
void CaloTowersCreationAlgo::process ( const CaloTowerCollection ctc)

Definition at line 281 of file CaloTowersCreationAlgo.cc.

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

281  {
282  for(CaloTowerCollection::const_iterator ctcItr = ctc.begin();
283  ctcItr != ctc.end(); ++ctcItr) {
284  rescale(&(*ctcItr));
285  }
286 }
std::vector< CaloTower >::const_iterator const_iterator
void rescale(const CaloTower *ct)
const_iterator end() const
const_iterator begin() const
void CaloTowersCreationAlgo::rescale ( const CaloTower ct)
private

Definition at line 695 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, dtT0WireCalibration_cfg::threshold, CaloTowerConstituentsMap::towerOf(), and CommonMethods::weight().

Referenced by process().

695  {
696  double threshold, weight;
697  CaloTowerDetId towerDetId = theTowerConstituentsMap->towerOf(ct->id());
698  if (towerDetId.null()) return;
699  MetaTower & tower = find(towerDetId);
700 
701  tower.E_em = 0.;
702  tower.E_had = 0.;
703  tower.E_outer = 0.;
704  for (unsigned int i=0; i<ct->constituentsSize(); i++) {
705  DetId detId = ct->constituent(i);
706  getThresholdAndWeight(detId, threshold, weight);
707  DetId::Detector det = detId.det();
708  if(det == DetId::Ecal) {
709  tower.E_em = ct->emEnergy()*weight;
710  }
711  else {
712  HcalDetId hcalDetId(detId);
713  if(hcalDetId.subdet() == HcalForward) {
714  if (hcalDetId.depth()==1) tower.E_em = ct->emEnergy()*weight;
715  if (hcalDetId.depth()==2) tower.E_had = ct->hadEnergy()*weight;
716  }
717  else if(hcalDetId.subdet() == HcalOuter) {
718  tower.E_outer = ct->outerEnergy()*weight;
719  }
720  else {
721  tower.E_had = ct->hadEnergy()*weight;
722  }
723  }
724  tower.E = tower.E_had+tower.E_em+tower.E_outer;
725 
726  // this is to be compliant with the new MetaTower setup
727  // used only for the default simple vector assignment
728  std::pair<DetId, double> mc(detId, 0);
729  tower.metaConstituents.push_back(mc);
730  }
731 
732  // preserve time inforamtion
733  tower.emSumTimeTimesE = ct->ecalTime();
734  tower.hadSumTimeTimesE = ct->hcalTime();
735  tower.emSumEForTime = 1.0;
736  tower.hadSumEForTime = 1.0;
737 }
int i
Definition: DBlmapReader.cc:9
size_t constituentsSize() const
Definition: CaloTower.h:74
DetId constituent(size_t i) const
Definition: CaloTower.h:75
float ecalTime() const
Definition: CaloTower.h:150
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:79
const CaloTowerConstituentsMap * theTowerConstituentsMap
double hadEnergy() const
Definition: CaloTower.h:80
Definition: DetId.h:20
CaloTowerDetId id() const
Definition: CaloTower.h:72
float hcalTime() const
Definition: CaloTower.h:151
Detector
Definition: DetId.h:26
bool null() const
is this a null id ?
Definition: DetId.h:47
void getThresholdAndWeight(const DetId &detId, double &threshold, double &weight) const
helper method to look up the appropriate threshold &amp; weight
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
double outerEnergy() const
Definition: CaloTower.h:81
void CaloTowersCreationAlgo::rescaleTowers ( const CaloTowerCollection ctInput,
CaloTowerCollection ctResult 
)

Definition at line 304 of file CaloTowersCreationAlgo.cc.

References CaloTower::addConstituents(), edm::SortedCollection< T, SORT >::begin(), edm::contains(), DetId::det(), DetId::Ecal, edm::SortedCollection< T, SORT >::end(), PV3DBase< T, PVType, FrameType >::eta(), getThresholdAndWeight(), DetId::Hcal, HcalOuter, CaloTowerDetId::ietaAbs(), PV3DBase< T, PVType, FrameType >::phi(), edm::SortedCollection< T, SORT >::push_back(), CaloTower::setCaloTowerStatus(), CaloTower::setEcalTime(), CaloTower::setHcalTime(), HcalDetId::subdet(), theHF1weight, theHF2weight, theHOIsUsed, dtT0WireCalibration_cfg::threshold, and CommonMethods::weight().

Referenced by CaloTowersReCreator::produce().

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

Definition at line 1086 of file CaloTowersCreationAlgo.cc.

References theEBEScale.

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

1086  {
1087  if (scale>0.00001) *&theEBEScale = scale;
1088  else *&theEBEScale = 50.;
1089 }
void CaloTowersCreationAlgo::setEbHandle ( const edm::Handle< EcalRecHitCollection eb)
inline

Definition at line 183 of file CaloTowersCreationAlgo.h.

References theEbHandle.

Referenced by CaloTowersCreator::produce().

183 { theEbHandle = eb; }
edm::Handle< EcalRecHitCollection > theEbHandle
void CaloTowersCreationAlgo::setEcalAcceptSeverityLevel ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setEcalAcceptSeverityLevelForRejectedHit ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setEcalChStatusFromDB ( const EcalChannelStatus s)
inline

Definition at line 110 of file CaloTowersCreationAlgo.h.

References asciidump::s, and theEcalChStatus.

Referenced by CaloTowersCreator::produce().

110 { theEcalChStatus = s; }
const EcalChannelStatus * theEcalChStatus
string s
Definition: asciidump.py:422
void CaloTowersCreationAlgo::setEcalSevLvlAlgo ( const EcalSeverityLevelAlgo a)
inline

Definition at line 162 of file CaloTowersCreationAlgo.h.

References a, and theEcalSevLvlAlgo.

Referenced by CaloTowersCreator::produce().

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

Definition at line 1091 of file CaloTowersCreationAlgo.cc.

References theEEEScale.

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

1091  {
1092  if (scale>0.00001) *&theEEEScale = scale;
1093  else *&theEEEScale = 50.;
1094 }
void CaloTowersCreationAlgo::setEeHandle ( const edm::Handle< EcalRecHitCollection ee)
inline

Definition at line 184 of file CaloTowersCreationAlgo.h.

References theEeHandle.

Referenced by CaloTowersCreator::produce().

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

Definition at line 241 of file CaloTowersCreationAlgo.cc.

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

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

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

Definition at line 1096 of file CaloTowersCreationAlgo.cc.

References theHBEScale.

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

1096  {
1097  if (scale>0.00001) *&theHBEScale = scale;
1098  else *&theHBEScale = 50.;
1099 }
void CaloTowersCreationAlgo::setHcalAcceptSeverityLevel ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setHcalAcceptSeverityLevelForRejectedHit ( unsigned int  level)
inline
void CaloTowersCreationAlgo::setHcalChStatusFromDB ( const HcalChannelQuality s)
inline

Definition at line 109 of file CaloTowersCreationAlgo.h.

References asciidump::s, and theHcalChStatus.

Referenced by CaloTowersCreator::produce().

109 { theHcalChStatus = s; }
const HcalChannelQuality * theHcalChStatus
string s
Definition: asciidump.py:422
void CaloTowersCreationAlgo::setHcalSevLvlComputer ( const HcalSeverityLevelComputer c)
inline

Definition at line 159 of file CaloTowersCreationAlgo.h.

References trackerHits::c, and theHcalSevLvlComputer.

Referenced by CaloTowersCreator::produce().

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

Definition at line 1106 of file CaloTowersCreationAlgo.cc.

References theHEDEScale.

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

1106  {
1107  if (scale>0.00001) *&theHEDEScale = scale;
1108  else *&theHEDEScale = 50.;
1109 }
void CaloTowersCreationAlgo::setHESEScale ( double  scale)

Definition at line 1101 of file CaloTowersCreationAlgo.cc.

References theHESEScale.

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

1101  {
1102  if (scale>0.00001) *&theHESEScale = scale;
1103  else *&theHESEScale = 50.;
1104 }
void CaloTowersCreationAlgo::setHF1EScale ( double  scale)

Definition at line 1116 of file CaloTowersCreationAlgo.cc.

References theHF1EScale.

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

1116  {
1117  if (scale>0.00001) *&theHF1EScale = scale;
1118  else *&theHF1EScale = 50.;
1119 }
void CaloTowersCreationAlgo::setHF2EScale ( double  scale)

Definition at line 1121 of file CaloTowersCreationAlgo.cc.

References theHF2EScale.

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

1121  {
1122  if (scale>0.00001) *&theHF2EScale = scale;
1123  else *&theHF2EScale = 50.;
1124 }
void CaloTowersCreationAlgo::setHOEScale ( double  scale)

Definition at line 1111 of file CaloTowersCreationAlgo.cc.

References theHOEScale.

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

1111  {
1112  if (scale>0.00001) *&theHOEScale = scale;
1113  else *&theHOEScale = 50.;
1114 }
void CaloTowersCreationAlgo::setRecoveredEcalHitsAreUsed ( bool  flag)
inline

Definition at line 156 of file CaloTowersCreationAlgo.h.

References theRecoveredEcalHitsAreUsed.

Referenced by CaloTowersCreator::produce().

long int flag
Definition: mlp_lapack.h:47
void CaloTowersCreationAlgo::setRecoveredHcalHitsAreUsed ( bool  flag)
inline

Definition at line 155 of file CaloTowersCreationAlgo.h.

References theRecoveredHcalHitsAreUsed.

Referenced by CaloTowersCreator::produce().

long int flag
Definition: mlp_lapack.h:47
void CaloTowersCreationAlgo::setUseRejectedHitsOnly ( bool  flag)
inline

Definition at line 169 of file CaloTowersCreationAlgo.h.

References useRejectedHitsOnly.

Referenced by CaloTowersCreator::produce().

long int flag
Definition: mlp_lapack.h:47
void CaloTowersCreationAlgo::setUseRejectedRecoveredEcalHits ( bool  flag)
inline

Definition at line 175 of file CaloTowersCreationAlgo.h.

References useRejectedRecoveredEcalHits.

Referenced by CaloTowersCreator::produce().

long int flag
Definition: mlp_lapack.h:47
void CaloTowersCreationAlgo::setUseRejectedRecoveredHcalHits ( bool  flag)
inline

Definition at line 174 of file CaloTowersCreationAlgo.h.

References useRejectedRecoveredHcalHits.

Referenced by CaloTowersCreator::produce().

long int flag
Definition: mlp_lapack.h:47

Member Data Documentation

HcalDropChMap CaloTowersCreationAlgo::hcalDropChMap
private

Definition at line 322 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and makeHcalDropChMap().

double CaloTowersCreationAlgo::theEBEScale
private

Definition at line 256 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEBEScale().

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

Definition at line 244 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 332 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and setEbHandle().

double CaloTowersCreationAlgo::theEBSumThreshold
private

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEBthreshold
private

Definition at line 234 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theEBweight
private

Definition at line 252 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 244 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

unsigned int CaloTowersCreationAlgo::theEcalAcceptSeverityLevel
private
unsigned int CaloTowersCreationAlgo::theEcalAcceptSeverityLevelForRejectedHit
private
const EcalChannelStatus* CaloTowersCreationAlgo::theEcalChStatus
private

Definition at line 270 of file CaloTowersCreationAlgo.h.

Referenced by setEcalChStatusFromDB().

const EcalSeverityLevelAlgo* CaloTowersCreationAlgo::theEcalSevLvlAlgo
private
double CaloTowersCreationAlgo::theEcutTower
private

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEEEScale
private

Definition at line 257 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setEEEScale().

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

Definition at line 245 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 333 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and setEeHandle().

double CaloTowersCreationAlgo::theEESumThreshold
private

Definition at line 254 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theEEthreshold
private

Definition at line 234 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theEEweight
private

Definition at line 252 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 245 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 258 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHBEScale().

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

Definition at line 246 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHBthreshold
private

Definition at line 241 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHBweight
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 246 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 239 of file CaloTowersCreationAlgo.h.

Referenced by convert().

const HcalTopology* CaloTowersCreationAlgo::theHcalTopology
private

Definition at line 264 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setGeometry().

double CaloTowersCreationAlgo::theHEDEScale
private

Definition at line 260 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHEDEScale().

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

Definition at line 248 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHEDthreshold
private

Definition at line 241 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHEDweight
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 248 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESEScale
private

Definition at line 259 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHESEScale().

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

Definition at line 247 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESthreshold
private

Definition at line 241 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHESweight
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 247 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1EScale
private

Definition at line 262 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF1EScale().

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

Definition at line 250 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1threshold
private

Definition at line 243 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF1weight
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

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

Definition at line 250 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2EScale
private

Definition at line 263 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHF2EScale().

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

Definition at line 251 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2threshold
private

Definition at line 243 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHF2weight
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and rescaleTowers().

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

Definition at line 251 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOEScale
private

Definition at line 261 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight(), and setHOEScale().

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

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

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

double CaloTowersCreationAlgo::theHOthreshold0
private

Definition at line 242 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdMinus1
private

Definition at line 242 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdMinus2
private

Definition at line 243 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdPlus1
private

Definition at line 242 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOthresholdPlus2
private

Definition at line 243 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

double CaloTowersCreationAlgo::theHOweight
private

Definition at line 253 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

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

Definition at line 249 of file CaloTowersCreationAlgo.h.

Referenced by getThresholdAndWeight().

int CaloTowersCreationAlgo::theMomConstrMethod
private

Definition at line 303 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomEBDepth
private

Definition at line 306 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomEEDepth
private

Definition at line 307 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomHBDepth
private

Definition at line 304 of file CaloTowersCreationAlgo.h.

Referenced by convert().

double CaloTowersCreationAlgo::theMomHEDepth
private

Definition at line 305 of file CaloTowersCreationAlgo.h.

Referenced by convert().

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

Definition at line 266 of file CaloTowersCreationAlgo.h.

Referenced by assignHit(), convert(), makeHcalDropChMap(), rescale(), and setGeometry().

const CaloSubdetectorGeometry* CaloTowersCreationAlgo::theTowerGeometry
private

Definition at line 267 of file CaloTowersCreationAlgo.h.

Referenced by convert(), and setGeometry().

MetaTowerMap CaloTowersCreationAlgo::theTowerMap
private

Definition at line 317 of file CaloTowersCreationAlgo.h.

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

bool CaloTowersCreationAlgo::theUseEtEBTresholdFlag
private

Definition at line 235 of file CaloTowersCreationAlgo.h.

Referenced by assignHit().

bool CaloTowersCreationAlgo::theUseEtEETresholdFlag
private

Definition at line 235 of file CaloTowersCreationAlgo.h.

Referenced by assignHit().

bool CaloTowersCreationAlgo::theUseSymEBTresholdFlag
private

Definition at line 236 of file CaloTowersCreationAlgo.h.

Referenced by assignHit().

bool CaloTowersCreationAlgo::theUseSymEETresholdFlag
private

Definition at line 236 of file CaloTowersCreationAlgo.h.

Referenced by assignHit().

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