58 const std::vector<std::string>
names_;
79 names_{iConfig.getParameter< std::vector<std::string> >(
"bitNames")},
104 std::vector<L1GtTechnicalTrigger> ttVec(
ttBits_.size());
109 if (!cf.failedToGet()) {
110 std::vector<float> EnergyBX(32);
111 std::vector<float> EnergyBXMinusDt(32);
113 for (
int c=0;
c<32;++
c){
115 EnergyBXMinusDt[
c]=0;
120 if (
edm::isDebugEnabled() )
LogDebug(
"BSCTrig")<<
" ----------------new event ---with "<<theBSCHitContainer.size()<<
" hits in the BSC";
123 for (
auto itHit = theBSCHitContainer.begin(); itHit != theBSCHitContainer.end(); ++itHit) {
124 float zh=itHit->entryPoint().z()/10;
126 if (
id > 31 )
continue;
127 float t=itHit->timeOfFlight();
130 float rh=
sqrt(itHit->entryPoint().x()*itHit->entryPoint().x()+itHit->entryPoint().y()*itHit->entryPoint().y())/10;
132 LogTrace(
"BSCTrig")<<
" Hit time="<<t<<
" accepted range=["<<dt2<<
","<<dt1<<
"] from a "<<
abs(itHit->particleType())<<
" with energy " <<itHit->energyLoss();
134 if (fabs(t)> dt1 || fabs(t) <dt2 )
continue;
135 if (t>0) EnergyBX[
id]+=itHit->energyLoss();
136 else EnergyBXMinusDt[
id]+=itHit->energyLoss();
140 int ZMinnerBX=0, ZMouterBX=0;
141 int ZPinnerBX=0, ZPouterBX=0;
142 int ZMinnerBXMinusDt=0, ZMouterBXMinusDt=0;
143 int ZPinnerBXMinusDt=0, ZPouterBXMinusDt=0;
147 constexpr float theThreshold=MipFraction*MipEnergy;
148 for (
unsigned int ipad = 0 ; ipad<32; ipad++) {
151 if ( EnergyBX[ipad] > theThreshold ) {
153 if (
isInner(ipad) ) ZPinnerBX++;
156 if (
isInner(ipad) ) ZMinnerBX++;
161 if ( EnergyBXMinusDt[ipad] > theThreshold ) {
163 if (
isInner(ipad) ) ZPinnerBXMinusDt++;
164 else ZPouterBXMinusDt++;
166 if (
isInner(ipad) ) ZMinnerBXMinusDt++;
167 else ZMouterBXMinusDt++;
172 if (
edm::isDebugEnabled() )
LogTrace(
"BSCTrig")<<
" Zplus I="<<ZPinnerBX<<
" Zminus I="<<ZMinnerBX<<
" Zplus O="<<ZPouterBX<<
" Zminus O="<<ZMouterBX;
176 if(ZPinnerBX >= 1 && ZMinnerBX >= 1) bit32 =
true;
179 if(ZPinnerBX >= 2 && ZMinnerBX >= 2) bit33 =
true;
182 if(ZPinnerBX + ZMinnerBX + ZPouterBX + ZMouterBX >= 1) bit34 =
true;
185 if(ZPinnerBX == 8 && ZMinnerBX == 8) bit35 =
true;
189 if(ZPinnerBX >= 1 && ZMinnerBXMinusDt >= 1) bit36 =
true;
192 if(ZPouterBX >= 1 && ZMouterBXMinusDt >= 1) bit37 =
true;
195 if(ZMinnerBX >= 1 && ZPinnerBXMinusDt >= 1) bit38 =
true;
198 if(ZMouterBX >= 1 && ZPouterBXMinusDt >= 1) bit39 =
true;
202 if(ZPinnerBX + ZPouterBX >= 1 && ZMinnerBX + ZMouterBX >= 1) bit40 =
true;
205 if(ZPinnerBX + ZPouterBX >= 2 && ZMinnerBX + ZMouterBX >= 2) bit41 =
true;
208 if(ZMinnerBX >= 2) bit42 =
true;
211 if(ZPinnerBX >= 2) bit43 =
true;
230 }
else ttVec.clear();
237 if ( z > 0 ) zside = 1;
239 int det = (
id&24)>>3;
241 LogTrace(
"BSCTrig")<<
"id="<<
id<<
" zside="<<zside<<
" det="<<det<<
" station="<<
station;
244 if (
id&16) BSCNum=32+(
id&1)+(zside<<1) ;
245 else BSCNum= (
id&15)+(zside<<4);
250 return ( (
id&8)>>3 ) ;
254 return ( (
id&16)>>4 ) ;
BSCTrigger(const edm::ParameterSet &)
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDPutTokenT< L1GtTechnicalTriggerRecord > thePutToken_
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< CrossingFrame< PSimHit > > theHitsToken_
const double theCoincidence_
const double theResolution_
const std::vector< unsigned > ttBits_
int getBSCNum(int id, float z) const
bool isZplus(int id) const
Abs< T >::type abs(const T &t)
bool isInner(int id) const
const std::vector< std::string > names_
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
void setGtTechnicalTrigger(const std::vector< L1GtTechnicalTrigger > >TechnicalTriggerValue)