28 double R2Min,
double R2Max,
29 double FracLeaderMin,
double FracLeaderMax,
30 double SlopeMin,
double SlopeMax,
31 double OuterMin,
double OuterMax,
32 double EnergyThreshold)
60 bool Bits[4]={
false,
false,
false,
false};
61 std::vector<HBHEDataFrame> digi =
const_cast<std::vector<HBHEDataFrame>&
>(udigi);
63 std::vector<double> PulseShape;
67 bool FoundLeadingChannel=
false;
68 for(std::vector<HBHEDataFrame>::const_iterator itDigi = digi.begin(); itDigi!=digi.end(); itDigi++)
70 if(!FoundLeadingChannel)
73 LeadingPhi = itDigi->id().iphi();
74 DigiSize=(*itDigi).size();
76 PulseShape.resize(DigiSize,0);
77 FoundLeadingChannel=
true;
79 if(
abs(LeadingPhi - itDigi->id().iphi())<2)
80 for(
int i=0;
i!=DigiSize;
i++)
81 PulseShape[
i]+=itDigi->sample(
i).nominal_fC();
87 if(RecHitIndex.size()>0)
89 double FracInLeader=-1;
93 double OuterEnergy=-1;
97 for(
int i=0;
i!=DigiSize;
i++)
99 if(PulseShape[
i]>PulseShape[PeakPosition])
101 TotalEnergy+=PulseShape[
i];
105 if(PeakPosition < (DigiSize-2))
107 R1 = PulseShape[PeakPosition+1]/PulseShape[PeakPosition];
108 R2 = PulseShape[PeakPosition+2]/PulseShape[PeakPosition+1];
111 FracInLeader = PulseShape[PeakPosition]/TotalEnergy;
113 if((PeakPosition > 0) && (PeakPosition < (DigiSize-2)))
115 OuterEnergy = 1. -((PulseShape[PeakPosition - 1] +
116 PulseShape[PeakPosition] +
117 PulseShape[PeakPosition + 1] +
118 PulseShape[PeakPosition + 2] )
133 if (R1!=-1 && R2!=-1)
135 if (FracInLeader!=-1)
136 Bits[1] = (FracInLeader < FracLeaderMin_) || (FracInLeader >
FracLeaderMax_);
138 Bits[2] = (OuterEnergy < OuterMin_) || (OuterEnergy >
OuterMax_);
153 for(
unsigned int i=0;
i!=RecHitIndex.size();
i++)
~HBHETimeProfileStatusBitSetter()
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, const std::vector< HBHEDataFrame > &, const std::vector< int > &)
HBHETimeProfileStatusBitSetter()