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};
62 std::vector<double> PulseShape;
66 bool FoundLeadingChannel=
false;
67 for(std::vector<HBHEDataFrame>::const_iterator itDigi = digi.begin(); itDigi!=digi.end(); itDigi++)
69 if(!FoundLeadingChannel)
71 LeadingEta = itDigi->id().ieta();
72 LeadingPhi = itDigi->id().iphi();
73 DigiSize=(*itDigi).size();
75 PulseShape.resize(DigiSize,0);
76 FoundLeadingChannel=
true;
78 if(
abs(LeadingPhi - itDigi->id().iphi())<2)
79 for(
int i=0;
i!=DigiSize;
i++)
80 PulseShape[
i]+=itDigi->sample(
i).nominal_fC();
86 if(RecHitIndex.size()>0)
88 double FracInLeader=-1;
92 double OuterEnergy=-1;
96 for(
int i=0;
i!=DigiSize;
i++)
98 if(PulseShape[
i]>PulseShape[PeakPosition])
100 TotalEnergy+=PulseShape[
i];
104 if(PeakPosition < (DigiSize-2))
106 R1 = PulseShape[PeakPosition+1]/PulseShape[PeakPosition];
107 R2 = PulseShape[PeakPosition+2]/PulseShape[PeakPosition+1];
110 FracInLeader = PulseShape[PeakPosition]/TotalEnergy;
112 if((PeakPosition > 0) && (PeakPosition < (DigiSize-2)))
114 OuterEnergy = 1. -((PulseShape[PeakPosition - 1] +
115 PulseShape[PeakPosition] +
116 PulseShape[PeakPosition + 1] +
117 PulseShape[PeakPosition + 2] )
132 if (R1!=-1 && R2!=-1)
134 if (FracInLeader!=-1)
135 Bits[1] = (FracInLeader < FracLeaderMin_) || (FracInLeader >
FracLeaderMax_);
137 Bits[2] = (OuterEnergy < OuterMin_) || (OuterEnergy >
OuterMax_);
152 for(
unsigned int i=0;
i!=RecHitIndex.size();
i++)
void hbheSetTimeFlagsFromDigi(HBHERecHitCollection *, std::vector< HBHEDataFrame >, std::vector< int >)
~HBHETimeProfileStatusBitSetter()
HBHETimeProfileStatusBitSetter()