28 double R2Min,
double R2Max,
29 double FracLeaderMin,
double FracLeaderMax,
30 double SlopeMin,
double SlopeMax,
31 double OuterMin,
double OuterMax,
58 return totalX > totalY;
65 bool Bits[4]={
false,
false,
false,
false};
66 std::vector<HBHEDataFrame> digi(udigi);
67 std::sort(digi.begin(), digi.end(), compareDigiEnergy);
68 std::vector<double> PulseShape;
72 bool FoundLeadingChannel=
false;
73 for(std::vector<HBHEDataFrame>::const_iterator itDigi = digi.begin(); itDigi!=digi.end(); itDigi++)
75 if(!FoundLeadingChannel)
78 LeadingPhi = itDigi->id().iphi();
79 DigiSize=(*itDigi).size();
81 PulseShape.resize(DigiSize,0);
82 FoundLeadingChannel=
true;
84 if(
abs(LeadingPhi - itDigi->id().iphi())<2)
85 for(
int i=0;
i!=DigiSize;
i++)
86 PulseShape[
i]+=itDigi->sample(
i).nominal_fC();
92 if(!RecHitIndex.empty())
94 double FracInLeader=-1;
98 double OuterEnergy=-1;
102 for(
int i=0;
i!=DigiSize;
i++)
104 if(PulseShape[
i]>PulseShape[PeakPosition])
106 TotalEnergy+=PulseShape[
i];
110 if(PeakPosition < (DigiSize-2))
112 R1 = PulseShape[PeakPosition+1]/PulseShape[PeakPosition];
113 R2 = PulseShape[PeakPosition+2]/PulseShape[PeakPosition+1];
116 FracInLeader = PulseShape[PeakPosition]/TotalEnergy;
118 if((PeakPosition > 0) && (PeakPosition < (DigiSize-2)))
120 OuterEnergy = 1. -((PulseShape[PeakPosition - 1] +
121 PulseShape[PeakPosition] +
122 PulseShape[PeakPosition + 1] +
123 PulseShape[PeakPosition + 2] )
138 if (R1!=-1 && R2!=-1)
140 if (FracInLeader!=-1)
141 Bits[1] = (FracInLeader < FracLeaderMin_) || (FracInLeader >
FracLeaderMax_);
143 Bits[2] = (OuterEnergy < OuterMin_) || (OuterEnergy >
OuterMax_);
158 for(
unsigned int i=0;
i!=RecHitIndex.size();
i++)
int size() const
total number of samples in the digi
~HBHETimeProfileStatusBitSetter()
Abs< T >::type abs(const T &t)
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, const std::vector< HBHEDataFrame > &, const std::vector< int > &)
HBHETimeProfileStatusBitSetter()
constexpr double nominal_fC() const
get the nominal FC (no calibrations applied)
HcalQIESample const & sample(int i) const
access a sample