41 #include <CLHEP/Vector/LorentzVector.h>
58 cout <<
"[DTTrigTest] Creating rootfile " << outputfile <<endl;
59 my_rootfile =
new TFile(outputfile.c_str(),
"RECREATE");
60 my_tree =
new TTree(
"h1",
"GMT",0);
62 if (
my_debug)
cout <<
"[DTTrigTest] Constructor executed!!!" << endl;
72 cout <<
"[DTTrigTest] Destructor executed!!!" << endl;
79 cout <<
"[DTTrigTest] Writing Tree and Closing File" << endl;
209 cout <<
"[DTTrigTest] TU's Created" << endl;
219 const float ptcut = 1.0;
220 const float etacut = 2.4;
223 cout <<
"[DTTrigTest] Trigger algorithm executed for run " << iEvent.
id().
run()
224 <<
" event " << iEvent.
id().
event() << endl;
236 vector<SimTrack>::const_iterator itrack;
239 cout <<
"[DTTrigTest] Tracks found in the detector (not only muons) " << MyTracks->size() <<endl;
241 for (itrack=MyTracks->begin(); itrack!=MyTracks->end(); itrack++){
242 if (
abs(itrack->type())==13){
244 float pt = momentum.Pt();
245 float eta = momentum.eta();
246 if ( pt>ptcut && fabs(eta)<etacut ){
247 float phi = momentum.phi();
248 int charge =
static_cast<int> (-itrack->type()/13);
249 if ( phi<0 ) phi = 2*
M_PI +
phi;
250 int vtxindex = itrack->vertIndex();
251 float gvx=0,gvy=0,gvz=0;
253 gvx=MyVertexes->at(vtxindex).position().x();
254 gvy=MyVertexes->at(vtxindex).position().y();
255 gvz=MyVertexes->at(vtxindex).position().z();
257 if (
ngen < MAXGEN ) {
277 vector<DTBtiTrigData>::const_iterator pbti;
280 cout <<
"[DTTrigTest] " << btitrigs.size() <<
" BTI triggers found" << endl;
282 for ( pbti = btitrigs.begin(); pbti != btitrigs.end(); pbti++ ) {
284 bwh[ibti]=pbti->wheel();
285 bstat[ibti]=pbti->station();
286 bsect[ibti]=pbti->sector();
287 bsl[ibti]=pbti->btiSL();
288 bnum[ibti]=pbti->btiNumber();
289 bbx[ibti]=pbti->step();
290 bcod[ibti]=pbti->code();
308 vector<DTTracoTrigData>::const_iterator ptc;
311 cout <<
"[DTTrigTest] " << tracotrigs.size() <<
" TRACO triggers found" << endl;
313 for (ptc=tracotrigs.begin(); ptc!=tracotrigs.end(); ptc++) {
315 twh[itraco]=ptc->wheel();
316 tstat[itraco]=ptc->station();
317 tsect[itraco]=ptc->sector();
318 tnum[itraco]=ptc->tracoNumber();
319 tbx[itraco]=ptc->step();
320 tcod[itraco]=ptc->code();
338 vector<DTChambPhSegm>::const_iterator ptsph;
341 cout <<
"[DTTrigTest] " << tsphtrigs.size() <<
" TSPhi triggers found" << endl;
343 for (ptsph=tsphtrigs.begin(); ptsph!=tsphtrigs.end(); ptsph++) {
345 swh[itsphi] = ptsph->wheel();
346 sstat[itsphi] = ptsph->station();
347 ssect[itsphi] = ptsph->sector();
348 sbx[itsphi] = ptsph->step();
349 scod[itsphi] = ptsph->oldCode();
350 sphi[itsphi] = ptsph->phi();
351 sphib[itsphi] = ptsph->phiB();
367 vector<DTChambThSegm>::const_iterator ptsth;
370 cout <<
"[DTTrigTest] " << tsthtrigs.size() <<
" TSTheta triggers found" << endl;
372 for (ptsth=tsthtrigs.begin(); ptsth!=tsthtrigs.end(); ptsth++) {
374 thwh[itstheta] = ptsth->ChamberId().wheel();
375 thstat[itstheta] = ptsth->ChamberId().station();
376 thsect[itstheta] = ptsth->ChamberId().sector();
377 thbx[itstheta] = ptsth->step();
378 for(
int i=0;
i<7;
i++) {
379 thcode[itstheta][
i] = ptsth->code(
i);
380 thpos[itstheta][
i] = ptsth->position(
i);
381 thqual[itstheta][
i] = ptsth->quality(
i);
390 vector<DTSectCollPhSegm>::const_iterator pscph;
393 cout <<
"[DTTrigTest] " << scphtrigs.size() <<
" SectCollPhi triggers found" << endl;
395 for (pscph=scphtrigs.begin(); pscph!=scphtrigs.end(); pscph++) {
398 scphwh[iscphi] = pscph->wheel();
399 scphstat[iscphi] = pscph->station();
401 scphbx[iscphi] = pscph->step();
402 scphcod[iscphi] = pscph->oldCode();
403 scphphi[iscphi] = pscph->phi();
420 vector<DTSectCollThSegm>::const_iterator pscth;
423 cout <<
"[DTTrigTest] " << scthtrigs.size() <<
" SectCollTheta triggers found" << endl;
425 for (pscth=scthtrigs.begin(); pscth!=scthtrigs.end(); pscth++) {
427 scthwh[isctheta] = pscth->ChamberId().wheel();
428 scthstat[isctheta] = pscth->ChamberId().station();
429 scthsect[isctheta] = pscth->ChamberId().sector();
430 scthbx[isctheta] = pscth->step();
431 for(
int i=0;
i<7;
i++) {
433 scthpos[isctheta][
i] = pscth->position(
i);
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet my_params
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
void analyze(const edm::Event &iEvent, const edm::EventSetup &iEventSetup)
Analyze function executed on all the events.
std::vector< DTSectCollPhSegm > SCPhTrigs()
Return a copy of all the Sector Collector (Phi) triggers.
static const double my_TtoTDC
void beginRun(const edm::Run &iRun, const edm::EventSetup &iEventSetup)
Create DTTrig instance and TUs.
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
GlobalPoint CMSPosition(const DTTrigData *trig) const
Coordinate of a trigger-data object in CMS frame.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
GlobalVector CMSDirection(const DTTrigData *trig) const
Direction of a trigger-data object in CMS frame.
std::vector< DTChambThSegm > TSThTrigs()
Return a copy of all the Trigger Server (Theta) triggers.
std::vector< DTTracoTrigData > TracoTrigs()
Return a copy of all the TRACO triggers.
DTTrigTest(const edm::ParameterSet &pset)
Constructor.
void beginJob()
Create tree and Branches.
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
void endJob()
Close Tree and write File.
std::vector< DTBtiTrigData > BtiTrigs()
Return a copy of all the BTI triggers.
std::vector< DTSectCollThSegm > SCThTrigs()
Return a copy of all the Sector Collector (Theta) triggers.
std::vector< DTChambPhSegm > TSPhTrigs()
Return a copy of all the Trigger Server (Phi) triggers.