88 produces<L1GtTechnicalTriggerRecord>();
109 std::vector<L1GtTechnicalTrigger> ttVec(
ttBits_.size());
110 std::vector<float>EnergyBX(32);
111 std::vector<float>EnergyBXMinusDt(32);
112 int ZMinnerBX=0, ZMouterBX=0;
113 int ZPinnerBX=0, ZPouterBX=0;
114 int ZMinnerBXMinusDt=0, ZMouterBXMinusDt=0;
115 int ZPinnerBXMinusDt=0, ZPouterBXMinusDt=0;
117 std::auto_ptr<L1GtTechnicalTriggerRecord> BscRecord;
118 float MipFraction=0.5;
119 float MipEnergy=0.0027;
120 float theThreshold=MipFraction*MipEnergy;
126 for (
int c=0;
c<32;++
c){
128 EnergyBXMinusDt[
c]=0;
135 if (
edm::isDebugEnabled() )
LogDebug(
"BSCTrig")<<
" ----------------new event ---with "<<theBSCHitContainer->size()<<
" hits in the BSC";
138 for (itHit = theBSCHitContainer->
begin(); itHit != theBSCHitContainer->
end(); ++itHit) {
139 float zh=itHit->entryPoint().z()/10;
141 if (
id > 31 )
continue;
142 float t=itHit->timeOfFlight();
145 float rh=
sqrt(itHit->entryPoint().x()*itHit->entryPoint().x()+itHit->entryPoint().y()*itHit->entryPoint().y())/10;
147 LogTrace(
"BSCTrig")<<
" Hit time="<<t<<
" accepted range=["<<dt2<<
","<<dt1<<
"] from a "<<
abs(itHit->particleType())<<
" with energy " <<itHit->energyLoss();
149 if (fabs(t)> dt1 || fabs(t) <dt2 )
continue;
150 if (t>0) EnergyBX[
id]+=itHit->energyLoss();
151 else EnergyBXMinusDt[
id]+=itHit->energyLoss();
155 for (
unsigned int ipad = 0 ; ipad<32; ipad++) {
158 if ( EnergyBX[ipad] > theThreshold ) {
160 if (
isInner(ipad) ) ZPinnerBX++;
163 if (
isInner(ipad) ) ZMinnerBX++;
168 if ( EnergyBXMinusDt[ipad] > theThreshold ) {
170 if (
isInner(ipad) ) ZPinnerBXMinusDt++;
171 else ZPouterBXMinusDt++;
173 if (
isInner(ipad) ) ZMinnerBXMinusDt++;
174 else ZMouterBXMinusDt++;
179 if (
edm::isDebugEnabled() )
LogTrace(
"BSCTrig")<<
" Zplus I="<<ZPinnerBX<<
" Zminus I="<<ZMinnerBX<<
" Zplus O="<<ZPouterBX<<
" Zminus O="<<ZMouterBX;
183 if(ZPinnerBX >= 1 && ZMinnerBX >= 1) bit32 =
true;
186 if(ZPinnerBX >= 2 && ZMinnerBX >= 2) bit33 =
true;
189 if(ZPinnerBX + ZMinnerBX + ZPouterBX + ZMouterBX >= 1) bit34 =
true;
192 if(ZPinnerBX == 8 && ZMinnerBX == 8) bit35 =
true;
196 if(ZPinnerBX >= 1 && ZMinnerBXMinusDt >= 1) bit36 =
true;
199 if(ZPouterBX >= 1 && ZMouterBXMinusDt >= 1) bit37 =
true;
202 if(ZMinnerBX >= 1 && ZPinnerBXMinusDt >= 1) bit38 =
true;
205 if(ZMouterBX >= 1 && ZPouterBXMinusDt >= 1) bit39 =
true;
209 if(ZPinnerBX + ZPouterBX >= 1 && ZMinnerBX + ZMouterBX >= 1) bit40 =
true;
212 if(ZPinnerBX + ZPouterBX >= 2 && ZMinnerBX + ZMouterBX >= 2) bit41 =
true;
215 if(ZMinnerBX >= 2) bit42 =
true;
218 if(ZPinnerBX >= 2) bit43 =
true;
237 }
else ttVec.clear();
239 output->setGtTechnicalTrigger(ttVec);
253 if ( z > 0 ) zside = 1;
255 int det = (
id&24)>>3;
257 LogTrace(
"BSCTrig")<<
"id="<<
id<<
" zside="<<zside<<
" det="<<det<<
" station="<<
station;
260 if (
id&16) BSCNum=32+(
id&1)+(zside<<1) ;
261 else BSCNum= (
id&15)+(zside<<4);
266 return ( (
id&8)>>3 ) ;
270 return ( (
id&16)>>4 ) ;
BSCTrigger(const edm::ParameterSet &)
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< unsigned > ttBits_
std::vector< std::string > names_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag TheHits_tag_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
int getBSCNum(int id, float z)