108 std::vector<L1GtTechnicalTrigger> ttVec(
ttBits_.size());
109 std::vector<float>EnergyBX(32);
110 std::vector<float>EnergyBXMinusDt(32);
111 int ZMinnerBX=0, ZMouterBX=0;
112 int ZPinnerBX=0, ZPouterBX=0;
113 int ZMinnerBXMinusDt=0, ZMouterBXMinusDt=0;
114 int ZPinnerBXMinusDt=0, ZPouterBXMinusDt=0;
116 std::auto_ptr<L1GtTechnicalTriggerRecord> BscRecord;
117 float MipFraction=0.5;
118 float MipEnergy=0.0027;
119 float theThreshold=MipFraction*MipEnergy;
125 for (
int c=0;
c<32;++
c){
127 EnergyBXMinusDt[
c]=0;
134 if (
edm::isDebugEnabled() )
LogDebug(
"BSCTrig")<<
" ----------------new event ---with "<<theBSCHitContainer->size()<<
" hits in the BSC";
137 for (itHit = theBSCHitContainer->begin(); itHit != theBSCHitContainer->end(); ++itHit) {
138 float zh=itHit->entryPoint().z()/10;
140 if (
id > 31 )
continue;
141 float t=itHit->timeOfFlight();
144 float rh=
sqrt(itHit->entryPoint().x()*itHit->entryPoint().x()+itHit->entryPoint().y()*itHit->entryPoint().y())/10;
146 LogTrace(
"BSCTrig")<<
" Hit time="<<t<<
" accepted range=["<<dt2<<
","<<dt1<<
"] from a "<<
abs(itHit->particleType())<<
" with energy " <<itHit->energyLoss();
148 if (fabs(t)> dt1 || fabs(t) <dt2 )
continue;
149 if (t>0) EnergyBX[id]+=itHit->energyLoss();
150 else EnergyBXMinusDt[id]+=itHit->energyLoss();
154 for (
unsigned int ipad = 0 ; ipad<32; ipad++) {
157 if ( EnergyBX[ipad] > theThreshold ) {
159 if (
isInner(ipad) ) ZPinnerBX++;
162 if (
isInner(ipad) ) ZMinnerBX++;
167 if ( EnergyBXMinusDt[ipad] > theThreshold ) {
169 if (
isInner(ipad) ) ZPinnerBXMinusDt++;
170 else ZPouterBXMinusDt++;
172 if (
isInner(ipad) ) ZMinnerBXMinusDt++;
173 else ZMouterBXMinusDt++;
178 if (
edm::isDebugEnabled() )
LogTrace(
"BSCTrig")<<
" Zplus I="<<ZPinnerBX<<
" Zminus I="<<ZMinnerBX<<
" Zplus O="<<ZPouterBX<<
" Zminus O="<<ZMouterBX;
182 if(ZPinnerBX >= 1 && ZMinnerBX >= 1) bit32 =
true;
185 if(ZPinnerBX >= 2 && ZMinnerBX >= 2) bit33 =
true;
188 if(ZPinnerBX + ZMinnerBX + ZPouterBX + ZMouterBX >= 1) bit34 =
true;
191 if(ZPinnerBX == 8 && ZMinnerBX == 8) bit35 =
true;
195 if(ZPinnerBX >= 1 && ZMinnerBXMinusDt >= 1) bit36 =
true;
198 if(ZPouterBX >= 1 && ZMouterBXMinusDt >= 1) bit37 =
true;
201 if(ZMinnerBX >= 1 && ZPinnerBXMinusDt >= 1) bit38 =
true;
204 if(ZMouterBX >= 1 && ZPouterBXMinusDt >= 1) bit39 =
true;
208 if(ZPinnerBX + ZPouterBX >= 1 && ZMinnerBX + ZMouterBX >= 1) bit40 =
true;
211 if(ZPinnerBX + ZPouterBX >= 2 && ZMinnerBX + ZMouterBX >= 2) bit41 =
true;
214 if(ZMinnerBX >= 2) bit42 =
true;
217 if(ZPinnerBX >= 2) bit43 =
true;
236 }
else ttVec.clear();
238 output->setGtTechnicalTrigger(ttVec);
std::vector< unsigned > ttBits_
std::vector< std::string > names_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Abs< T >::type abs(const T &t)
edm::InputTag TheHits_tag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
int getBSCNum(int id, float z)