CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CommonHcalNoiseRBXData Class Reference

#include <HcalNoiseAlgo.h>

Public Member Functions

bool CheckPassFilter (double Charge, double Discriminant, std::vector< std::pair< double, double > > &Cuts, int Side)
 
 CommonHcalNoiseRBXData (const reco::HcalNoiseRBX &rbx, double minRecHitE, double minLowHitE, double minHighHitE, double TS4TS5EnergyThreshold, std::vector< std::pair< double, double > > &TS4TS5UpperCut, std::vector< std::pair< double, double > > &TS4TS5LowerCut)
 
double e10ts (void) const
 
double e2ts (void) const
 
double energy (void) const
 
double highEHitTimeSqrd (void) const
 
double HPDEMF (void) const
 
double lowEHitTimeSqrd (void) const
 
double maxHighEHitTime (void) const
 
double maxLowEHitTime (void) const
 
double minHighEHitTime (void) const
 
double minLowEHitTime (void) const
 
int numHighEHits (void) const
 
int numHPDHits (void) const
 
int numHPDNoOtherHits (void) const
 
int numLowEHits (void) const
 
int numRBXHits (void) const
 
int numZeros (void) const
 
bool PassTS4TS5 (void) const
 
double ratio (void) const
 
double RBXEMF (void) const
 
edm::RefVector
< CaloTowerCollection
rbxTowers (void) const
 
bool validRatio (void) const
 
 ~CommonHcalNoiseRBXData ()
 

Private Attributes

double e10ts_
 
double e2ts_
 
double energy_
 
double highEHitTimeSqrd_
 
double HPDEMF_
 
double lowEHitTimeSqrd_
 
double maxHighEHitTime_
 
double maxLowEHitTime_
 
double minHighEHitTime_
 
double minLowEHitTime_
 
int numHighEHits_
 
int numHPDHits_
 
int numHPDNoOtherHits_
 
int numLowEHits_
 
int numRBXHits_
 
int numZeros_
 
double RBXEMF_
 
edm::RefVector
< CaloTowerCollection
rbxtowers_
 
bool TS4TS5Decision_
 

Detailed Description

Definition at line 11 of file HcalNoiseAlgo.h.

Constructor & Destructor Documentation

CommonHcalNoiseRBXData::CommonHcalNoiseRBXData ( const reco::HcalNoiseRBX rbx,
double  minRecHitE,
double  minLowHitE,
double  minHighHitE,
double  TS4TS5EnergyThreshold,
std::vector< std::pair< double, double > > &  TS4TS5UpperCut,
std::vector< std::pair< double, double > > &  TS4TS5LowerCut 
)

Definition at line 3 of file HcalNoiseAlgo.cc.

References reco::HcalNoiseRBX::allCharge(), reco::HcalNoiseRBX::allChargeHighest2TS(), reco::HcalNoiseRBX::allChargeTotal(), edm::RefVector< C, T, F >::begin(), reco::HcalNoiseRBX::caloTowerEmE(), CheckPassFilter(), edm::RefVector< C, T, F >::clear(), e10ts_, e2ts_, edm::RefVector< C, T, F >::end(), energy(), energy_, highEHitTimeSqrd_, HPDEMF_, reco::HcalNoiseRBX::HPDsBegin(), reco::HcalNoiseRBX::HPDsEnd(), join(), lowEHitTimeSqrd_, maxHighEHitTime_, maxLowEHitTime_, minHighEHitTime_, minLowEHitTime_, numHighEHits_, numHPDHits_, numHPDNoOtherHits_, numLowEHits_, numRBXHits_, reco::HcalNoiseRBX::numRecHits(), numZeros_, RBXEMF_, rbxtowers_, reco::HcalNoiseRBX::recHitEnergy(), HI_PhotonSkim_cff::rechits, cond::rpcobgas::time, reco::HcalNoiseRBX::totalZeros(), and TS4TS5Decision_.

7 {
8  // energy
9  energy_ = rbx.recHitEnergy(minRecHitE);
10 
11  // ratio
12  e2ts_ = rbx.allChargeHighest2TS();
13  e10ts_ = rbx.allChargeTotal();
14 
15  // TS4TS5
16  TS4TS5Decision_ = true;
17  if(energy_ > TS4TS5EnergyThreshold) // check filter
18  {
19  std::vector<float> AllCharge = rbx.allCharge();
20  double BaseCharge = AllCharge[4] + AllCharge[5];
21  if(BaseCharge < 1)
22  BaseCharge = 1;
23  double TS4TS5 = (AllCharge[4] - AllCharge[5]) / BaseCharge;
24 
25  if(CheckPassFilter(BaseCharge, TS4TS5, TS4TS5UpperCut, 1) == false)
26  TS4TS5Decision_ = false;
27  if(CheckPassFilter(BaseCharge, TS4TS5, TS4TS5LowerCut, -1) == false)
28  TS4TS5Decision_ = false;
29  }
30  else
31  TS4TS5Decision_ = true;
32 
33  // # of hits
34  numHPDHits_ = 0;
35  for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.HPDsBegin(); it1!=rbx.HPDsEnd(); ++it1) {
36  int nhpdhits=it1->numRecHits(minRecHitE);
37  if(numHPDHits_ < nhpdhits) numHPDHits_ = nhpdhits;
38  }
39  numRBXHits_ = rbx.numRecHits(minRecHitE);
41 
42  // # of ADC zeros
43  numZeros_ = rbx.totalZeros();
44 
45  // timing
50  for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.HPDsBegin(); it1!=rbx.HPDsEnd(); ++it1) {
52  for(edm::RefVector<HBHERecHitCollection>::const_iterator it2=rechits.begin(); it2!=rechits.end(); ++it2) {
53  float energy=(*it2)->energy();
54  float time=(*it2)->time();
55  if(energy>=minLowHitE) {
58  lowEHitTimeSqrd_ += time*time;
59  ++numLowEHits_;
60  }
61  if(energy>=minHighHitE) {
64  highEHitTimeSqrd_ += time*time;
65  ++numHighEHits_;
66  }
67  }
68  }
69 
70  // emf
71  HPDEMF_ = 999.;
72  for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.HPDsBegin(); it1!=rbx.HPDsEnd(); ++it1) {
73  double eme=it1->caloTowerEmE();
74  double hade=it1->recHitEnergy(minRecHitE);
75  double emf=(eme+hade)==0 ? 999 : eme/(eme+hade);
76  if(HPDEMF_ > emf) emf = HPDEMF_;
77  }
78  double eme=rbx.caloTowerEmE();
79  RBXEMF_ = (eme+energy_)==0 ? 999 : eme/(eme+energy_);
80 
81  // calotowers
82  rbxtowers_.clear();
84  for(std::vector<reco::HcalNoiseHPD>::const_iterator it1=rbx.HPDsBegin(); it1!=rbx.HPDsEnd(); ++it1) {
85  join(rbxtowers_, it1->caloTowers());
86  }
87 
88  return;
89 }
bool CheckPassFilter(double Charge, double Discriminant, std::vector< std::pair< double, double > > &Cuts, int Side)
float allChargeHighest2TS(unsigned int firstts=4) const
Definition: HcalNoiseRBX.cc:65
std::vector< HcalNoiseHPD >::const_iterator HPDsBegin(void) const
Definition: HcalNoiseRBX.h:61
int numRecHits(double threshold=1.5) const
std::vector< HcalNoiseHPD >::const_iterator HPDsEnd(void) const
Definition: HcalNoiseRBX.h:62
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
edm::RefVector< CaloTowerCollection > rbxtowers_
Definition: HcalNoiseAlgo.h:65
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
double caloTowerEmE(void) const
double recHitEnergy(double theshold=1.5) const
Definition: HcalNoiseRBX.cc:99
float allChargeTotal(void) const
Definition: HcalNoiseRBX.cc:57
int totalZeros(void) const
Definition: HcalNoiseRBX.cc:82
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
void clear()
Clear the vector.
Definition: RefVector.h:133
double energy(void) const
Definition: HcalNoiseAlgo.h:20
const std::vector< float > allCharge(void) const
Definition: HcalNoiseRBX.cc:52
CommonHcalNoiseRBXData::~CommonHcalNoiseRBXData ( )
inline

Definition at line 17 of file HcalNoiseAlgo.h.

17 {}

Member Function Documentation

bool CommonHcalNoiseRBXData::CheckPassFilter ( double  Charge,
double  Discriminant,
std::vector< std::pair< double, double > > &  Cuts,
int  Side 
)

Definition at line 280 of file HcalNoiseAlgo.cc.

References first, i, and MessageLogger_cff::limit.

Referenced by CommonHcalNoiseRBXData().

282 {
283  //
284  // Checks whether Discriminant value passes Cuts for the specified Charge. True if pulse is good.
285  //
286  // The "Cuts" pairs are assumed to be sorted in terms of size from small to large,
287  // where each "pair" = (Charge, Discriminant)
288  // "Side" is either positive or negative, which determines whether to discard the pulse if discriminant
289  // is greater or smaller than the cut value
290  //
291 
292  if(Cuts.size() == 0) // safety check that there are some cuts defined
293  return true;
294 
295  if(Charge <= Cuts[0].first) // too small to cut on
296  return true;
297 
298  int IndexLargerThanCharge = -1; // find the range it is falling in
299  for(int i = 1; i < (int)Cuts.size(); i++)
300  {
301  if(Cuts[i].first > Charge)
302  {
303  IndexLargerThanCharge = i;
304  break;
305  }
306  }
307 
308  double limit = 1000000;
309 
310  if(IndexLargerThanCharge == -1) // if charge is greater than the last entry, assume flat line
311  limit = Cuts[Cuts.size()-1].second;
312  else // otherwise, do a linear interpolation to find the cut position
313  {
314  double C1 = Cuts[IndexLargerThanCharge].first;
315  double C2 = Cuts[IndexLargerThanCharge-1].first;
316  double L1 = Cuts[IndexLargerThanCharge].second;
317  double L2 = Cuts[IndexLargerThanCharge-1].second;
318 
319  limit = (Charge - C1) / (C2 - C1) * (L2 - L1) + L1;
320  }
321 
322  if(Side > 0 && Discriminant > limit)
323  return false;
324  if(Side < 0 && Discriminant < limit)
325  return false;
326 
327  return true;
328 }
int i
Definition: DBlmapReader.cc:9
bool first
Definition: L1TdeRCT.cc:79
double CommonHcalNoiseRBXData::e10ts ( void  ) const
inline

Definition at line 23 of file HcalNoiseAlgo.h.

References e10ts_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

23 { return e10ts_; }
double CommonHcalNoiseRBXData::e2ts ( void  ) const
inline

Definition at line 22 of file HcalNoiseAlgo.h.

References e2ts_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

22 { return e2ts_; }
double CommonHcalNoiseRBXData::energy ( void  ) const
inline
double CommonHcalNoiseRBXData::highEHitTimeSqrd ( void  ) const
inline

Definition at line 35 of file HcalNoiseAlgo.h.

References highEHitTimeSqrd_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

35 { return highEHitTimeSqrd_; }
double CommonHcalNoiseRBXData::HPDEMF ( void  ) const
inline
double CommonHcalNoiseRBXData::lowEHitTimeSqrd ( void  ) const
inline

Definition at line 31 of file HcalNoiseAlgo.h.

References lowEHitTimeSqrd_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

31 { return lowEHitTimeSqrd_; }
double CommonHcalNoiseRBXData::maxHighEHitTime ( void  ) const
inline
double CommonHcalNoiseRBXData::maxLowEHitTime ( void  ) const
inline
double CommonHcalNoiseRBXData::minHighEHitTime ( void  ) const
inline
double CommonHcalNoiseRBXData::minLowEHitTime ( void  ) const
inline
int CommonHcalNoiseRBXData::numHighEHits ( void  ) const
inline

Definition at line 36 of file HcalNoiseAlgo.h.

References numHighEHits_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

36 { return numHighEHits_; }
int CommonHcalNoiseRBXData::numHPDHits ( void  ) const
inline
int CommonHcalNoiseRBXData::numHPDNoOtherHits ( void  ) const
inline
int CommonHcalNoiseRBXData::numLowEHits ( void  ) const
inline

Definition at line 32 of file HcalNoiseAlgo.h.

References numLowEHits_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

32 { return numLowEHits_; }
int CommonHcalNoiseRBXData::numRBXHits ( void  ) const
inline
int CommonHcalNoiseRBXData::numZeros ( void  ) const
inline
bool CommonHcalNoiseRBXData::PassTS4TS5 ( void  ) const
inline

Definition at line 39 of file HcalNoiseAlgo.h.

References TS4TS5Decision_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

39 { return TS4TS5Decision_; }
double CommonHcalNoiseRBXData::ratio ( void  ) const
inline
double CommonHcalNoiseRBXData::RBXEMF ( void  ) const
inline
edm::RefVector<CaloTowerCollection> CommonHcalNoiseRBXData::rbxTowers ( void  ) const
inline

Definition at line 40 of file HcalNoiseAlgo.h.

References rbxtowers_.

Referenced by reco::HcalNoiseInfoProducer::fillOtherSummaryVariables().

40 { return rbxtowers_; }
edm::RefVector< CaloTowerCollection > rbxtowers_
Definition: HcalNoiseAlgo.h:65
bool CommonHcalNoiseRBXData::validRatio ( void  ) const
inline

Member Data Documentation

double CommonHcalNoiseRBXData::e10ts_
private

Definition at line 49 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), e10ts(), ratio(), and validRatio().

double CommonHcalNoiseRBXData::e2ts_
private

Definition at line 48 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), e2ts(), and ratio().

double CommonHcalNoiseRBXData::energy_
private

Definition at line 47 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and energy().

double CommonHcalNoiseRBXData::highEHitTimeSqrd_
private

Definition at line 60 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and highEHitTimeSqrd().

double CommonHcalNoiseRBXData::HPDEMF_
private

Definition at line 62 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and HPDEMF().

double CommonHcalNoiseRBXData::lowEHitTimeSqrd_
private

Definition at line 56 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and lowEHitTimeSqrd().

double CommonHcalNoiseRBXData::maxHighEHitTime_
private

Definition at line 59 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and maxHighEHitTime().

double CommonHcalNoiseRBXData::maxLowEHitTime_
private

Definition at line 55 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and maxLowEHitTime().

double CommonHcalNoiseRBXData::minHighEHitTime_
private

Definition at line 58 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and minHighEHitTime().

double CommonHcalNoiseRBXData::minLowEHitTime_
private

Definition at line 54 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and minLowEHitTime().

int CommonHcalNoiseRBXData::numHighEHits_
private

Definition at line 61 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and numHighEHits().

int CommonHcalNoiseRBXData::numHPDHits_
private

Definition at line 50 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and numHPDHits().

int CommonHcalNoiseRBXData::numHPDNoOtherHits_
private

Definition at line 52 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and numHPDNoOtherHits().

int CommonHcalNoiseRBXData::numLowEHits_
private

Definition at line 57 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and numLowEHits().

int CommonHcalNoiseRBXData::numRBXHits_
private

Definition at line 51 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and numRBXHits().

int CommonHcalNoiseRBXData::numZeros_
private

Definition at line 53 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and numZeros().

double CommonHcalNoiseRBXData::RBXEMF_
private

Definition at line 63 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and RBXEMF().

edm::RefVector<CaloTowerCollection> CommonHcalNoiseRBXData::rbxtowers_
private

Definition at line 65 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and rbxTowers().

bool CommonHcalNoiseRBXData::TS4TS5Decision_
private

Definition at line 64 of file HcalNoiseAlgo.h.

Referenced by CommonHcalNoiseRBXData(), and PassTS4TS5().