25 produces<L1GtTechnicalTriggerRecord>();
36 std::vector<L1GtTechnicalTrigger> vecTT(
ttpBits_.size()) ;
42 if ( !CastorDigiColl.failedToGet() ) {
44 double cas_efC[16][14];
48 std::vector<bool> decision(
ttpBits_.size());
64 output->setGtTechnicalTrigger(vecTT) ;
79 for(
int isec=0; isec<16; isec++)
for(
int imod=0; imod<14; imod++) energy[isec][imod] = 0;
83 for (idigi=CastorDigiColl->begin(); idigi!=CastorDigiColl->end(); idigi++) {
88 const CastorQIECoder* channelCoder = conditions->getCastorCoder(cell);
114 if( decision.size() < 4 )
return;
116 std::vector<bool> tdpo[8];
121 decision.at(0) =
true;
122 decision.at(1) =
false;
123 decision.at(2) =
false;
124 decision.at(3) =
false;
130 for(
int ioct=0; ioct<8; ioct++) {
131 int next_oct = (ioct+1)%8;
132 int prev_oct = (ioct+8-1)%8;
135 if( !tdpo[ioct].at(0) ) decision.at(0) =
false;
136 if( !tdpo[ioct].at(1) ) decision.at(0) =
false;
139 if( tdpo[ioct].at(2) ) decision.at(1) =
true;
147 if( tdpo[ioct].at(5) ) {
150 if( tdpo[ioct].at(0) ) {
151 if( tdpo[prev_oct].at(1) &&
152 tdpo[next_oct].at(0) &&
153 tdpo[next_oct].at(1) )
154 decision.at(3) =
true;
156 else if( tdpo[ioct].at(1) ) {
157 if( tdpo[prev_oct].at(0) &&
158 tdpo[prev_oct].at(1) &&
159 tdpo[next_oct].at(0) )
160 decision.at(3) =
true;
166 if( tdpo[ioct].at(6) ) decision.at(2) =
true;
179 for(
int ioct=0; ioct<8; ioct++)
190 tdpo[ioct].resize(7);
192 for(
int ibit=0; ibit<7; ibit++)
193 tdpo[ioct].at(ibit) =
false;
196 for(
int ioctsec=0; ioctsec<2; ioctsec++)
199 int isec = 2*ioct+ioctsec;
202 double fCsum_mod = 0;
203 double fCsum_em = 0, fCsum_ha = 0;
204 double fCsum_jet_had = 0;
205 double fCsum_col[3] = { 0, 0, 0 };
208 for(
int imod=0; imod<14; imod++) {
210 fCsum_mod += energy[isec][imod];
213 if( imod < 2 ) fCsum_em += energy[isec][imod];
214 if( imod > 2 && imod < 12 ) fCsum_ha += energy[isec][imod];
217 if( imod < 4 ) fCsum_col[0] += energy[isec][imod];
218 else if( imod < 8 ) fCsum_col[1] += energy[isec][imod];
219 else if( imod < 12 ) fCsum_col[2] += energy[isec][imod];
222 if( imod > 1 && imod < 5 ) fCsum_jet_had += energy[isec][imod];
227 if( ioctsec == 0 ) tdpo[ioct].at(0) =
true;
228 else if( ioctsec == 1 ) tdpo[ioct].at(1) =
true;
240 tdpo[ioct].at(2) =
true;
244 tdpo[ioct].at(6) =
true;
249 tdpo[ioct].at(3) =
true;
251 tdpo[ioct].at(4) =
true;
254 int countColumns = 0;
255 for(
int icol=0; icol<3; icol++ )
258 if( countColumns >= 2 )
259 tdpo[ioct].at(5) =
true;
T getParameter(std::string const &) const
int sector() const
get the sector (1-16)
std::vector< unsigned int > ttpBits_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
CastorTTRecord(const edm::ParameterSet &ps)
unsigned int CastorSignalTS_
std::vector< std::string > TrigNames_
std::vector< CastorDataFrame >::const_iterator const_iterator
int module() const
get the module (1-2 for EM, 1-12 for HAD)
std::vector< double > TrigThresholds_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::Event &e, const edm::EventSetup &c)
void getTriggerDecisionsPerOctant(std::vector< bool > tdps[16], double energy[16][14]) const
double pedestal(int fCapId) const
get pedestal for capid=0..3
double gain(int fCapId) const
get gain for capid=0..3
void getTriggerDecisions(std::vector< bool > &decision, double energy[16][14]) const
virtual void adc2fC(const CastorDataFrame &df, CaloSamples &lf) const
edm::EDGetTokenT< CastorDigiCollection > CastorDigiColl_
const HcalCastorDetId & id() const
void getEnergy_fC(double energy[16][14], edm::Handle< CastorDigiCollection > &CastorDigiColl, edm::Event &e, const edm::EventSetup &c)
virtual ~CastorTTRecord()