CMS 3D CMS Logo

DTTrig.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class: DTTrig
00004 //
00005 //   Description: Steering routine for L1 trigger simulation in
00006 //                a muon barrel station
00007 //
00008 //
00009 //   Author List:
00010 //   C. Grandi
00011 //   Modifications: 
00012 //   S Vanini, S. Marcellini, D. Bonacorsi,  C.Battilana
00013 //
00014 //   07/03/30 : configuration now through DTConfigManager SV
00015 //-------------------------------------------------------
00016 
00017 //-----------------------
00018 // This Class's Header --
00019 //-----------------------
00020 #include "L1Trigger/DTTrigger/interface/DTTrig.h"
00021 
00022 #include "FWCore/Framework/interface/Event.h"
00023 #include "FWCore/Framework/interface/ESHandle.h"
00024 #include "DataFormats/Common/interface/Handle.h"
00025 #include "FWCore/ParameterSet/interface/InputTag.h"
00026 #include "CalibMuon/DTDigiSync/interface/DTTTrigSyncFactory.h"
00027 #include "CalibMuon/DTDigiSync/interface/DTTTrigBaseSync.h"
00028 
00029 #include "Geometry/DTGeometry/interface/DTGeometry.h"
00030 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00031 #include "Geometry/DTGeometry/interface/DTLayer.h"
00032 #include "Geometry/DTGeometry/interface/DTChamber.h"
00033 #include "CondFormats/DTObjects/interface/DTT0.h"
00034 #include "CondFormats/DataRecord/interface/DTT0Rcd.h"
00035 #include "CondFormats/DTObjects/interface/DTTtrig.h"
00036 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
00037 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
00038 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManagerRcd.h"
00039 
00040 //---------------
00041 // C++ Headers --
00042 //---------------
00043 #include <iostream>
00044 #include <string>
00045 
00046 //-------------------------------
00047 // Collaborating Class Headers --
00048 //-------------------------------
00049 #include "Geometry/DTGeometry/interface/DTChamber.h"
00050 
00051 //----------------
00052 // Constructors --
00053 //----------------
00054 
00055 DTTrig::DTTrig(const  edm::ParameterSet &params) : 
00056   _configid(0) , _geomid(0) , _t0id(0) , _ttrigid(0) {
00057 
00058   // Set configuration parameters
00059   // _debug = _conf_manager->getDTTPGDebug();
00060   _debug = params.getUntrackedParameter<bool>("debug"); // CB FIXME: update when debug will be fully configured from parameter set
00061 
00062   if(_debug){
00063     std::cout << std::endl;
00064     std::cout << "**** Initialization of DTTrigger ****" << std::endl;
00065     std::cout << std::endl;
00066     std::cout << "DTTrig::DTTrig creating synchronizer" << std::endl;
00067   }
00068 
00069   _digitag   = params.getParameter<edm::InputTag>("digiTag");
00070   _digi_sync = DTTTrigSyncFactory::get()->create(params.getParameter<std::string>("tTrigMode"),
00071                                               params.getParameter<edm::ParameterSet>("tTrigModeConfig"));
00072   _usesyncdb = params.getParameter<std::string>("tTrigMode")!="DTTTrigSyncTOFCorr";
00073 }
00074 
00075 
00076 //--------------
00077 // Destructor --
00078 //--------------
00079 DTTrig::~DTTrig(){
00080 
00081   clear();
00082   delete _digi_sync; //CB check if it is really needed
00083 
00084 }
00085 
00086 void 
00087 DTTrig::createTUs(const edm::EventSetup& iSetup ){
00088   
00089   // build up Sector Collectors and then
00090   // build the trrigger units (one for each chamber)
00091   for(int iwh=-2;iwh<=2;iwh++){ 
00092     for(int ise=1;ise<=12;ise++){ 
00093       if(_debug){
00094         std::cout << "calling sectcollid wh sc " << iwh <<  " " << ise << std::endl;}
00095       DTSectCollId scid(iwh,ise);
00096       SC_iterator it =  _cache1.find(scid);
00097       if ( it != _cache1.end()) {
00098         std::cout << "DTTrig::createTUs: Sector Collector unit already exists"<<std::endl;
00099         continue;
00100       }    
00101       // add a sector collector to the map
00102       // SCConf_iterator scit = _scconf.find(scid);
00103       //edm::ParameterSet sc_pset = _conf_pset.getParameter<edm::ParameterSet>("SectCollParameters");
00104       DTSectColl* sc;
00105       //sc = new DTSectColl(sc_pset);
00106       sc = new DTSectColl(scid);
00107 
00108       //  if ( scit != _scconf.end()){
00109       //        sc = new DTSectColl( (*scit).second);
00110       //       }
00111       //       else {
00112       //        std::cout << "DTTrig::createTUs: SC config file does not exist. Using default one";
00113       //        sc = new DTSectColl(config());
00114       //       }
00115       if(_debug){
00116         std::cout << " DTTrig::createTUs new SC sc = " << sc  
00117                   << " at scid.sector() " << scid.sector() 
00118                   << " at scid.wheel() " << scid.wheel()   
00119                   << std::endl;
00120       }
00121       _cache1[scid] = sc;  
00122     }
00123   }
00124   
00125   edm::ESHandle<DTGeometry>pDD;
00126   iSetup.get<MuonGeometryRecord>().get(pDD);
00127   for (std::vector<DTChamber*>::const_iterator ich=pDD->chambers().begin(); ich!=pDD->chambers().end();ich++){
00128        
00129     DTChamber* chamb = (*ich);
00130     DTChamberId chid = chamb->id();
00131     TU_iterator it = _cache.find(chid);
00132     if ( it != _cache.end()) {
00133       std::cout << "DTTrig::init: Trigger unit already exists" << std::endl;
00134       continue;
00135     }    
00136     //    Conf_iterator cit = _truconf.find(chid);
00137     //       if ( cit == _truconf.end()) {
00138     //  std::cout << "DTTrig::init: Local Config File not found using default config" << std::endl;
00139     //  DTSCTrigUnit* tru = new DTSCTrigUnit(chamb,config());
00140     //  _cache[chid] = tru;
00141     //  continue;
00142     //       }
00143 
00144     // add a trigger unit to the map with a link to the station
00145     //edm::ParameterSet tu_pset = _conf_pset.getParameter<edm::ParameterSet>("TUParameters");
00146     //DTSCTrigUnit* tru = new DTSCTrigUnit(chamb,tu_pset);
00147     DTSCTrigUnit* tru = new DTSCTrigUnit(chamb,_digi_sync);
00148     _cache[chid] = tru;
00149     
00150     //----------- add TU to corresponding SC
00151     // returning correspondent SC id
00152     DTSectCollId scid;
00153     if(chid.sector()==13) { 
00154       scid = DTSectCollId(chid.wheel(), 4);}
00155     else if(chid.sector()==14)  {
00156       scid = DTSectCollId(chid.wheel(), 10);}
00157     else  { 
00158       scid = DTSectCollId(chid.wheel(), chid.sector() );}
00159     
00160     SC_iterator it1 =  _cache1.find(scid);
00161     
00162     if ( it1 != _cache1.end()) {
00163       
00164       DTSectColl* sc = (*it1).second;
00165       if(_debug) {
00166         std::cout << "DTTrig::init:  adding TU in SC << " 
00167                   << " sector = " << scid.sector() 
00168                   << " wheel = " << scid.wheel() 
00169                   << std::endl;}
00170       sc->addTU(tru);    
00171     }
00172     else {
00173       std::cout << "DTTrig::createTUs: Trigger Unit not in the map: ";
00174     }
00175     
00176   }
00177 
00178 }
00179 
00180 
00181 void 
00182 DTTrig::triggerReco(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
00183 
00184   updateES(iSetup);
00185 
00186   DTDigiMap digiMap;
00187   //Sort digis by chamber so they can be used by BTIs
00188   edm::Handle<DTDigiCollection> dtDigis;
00189   iEvent.getByLabel(_digitag, dtDigis);   
00190   DTDigiCollection::DigiRangeIterator detUnitIt;
00191   
00192   for (detUnitIt=dtDigis->begin();
00193        detUnitIt!=dtDigis->end();
00194        ++detUnitIt){
00195     const DTLayerId& layId = (*detUnitIt).first;
00196     const DTChamberId chambId=layId.superlayerId().chamberId();
00197     const DTDigiCollection::Range& range = (*detUnitIt).second;
00198     //    DTDigiCollection tmpDTDigiColl;
00199     //tmpDTDigiColl.put(range,layId); 
00200     digiMap[chambId].put(range,layId); 
00201 //     const DTDigiCollection::Range& range = (*detUnitIt).second;
00202 //     for (DTDigiCollection::const_iterator digiIt = range.first;
00203 //       digiIt!=range.second;
00204 //       ++digiIt){
00205 //       DTDigiCollection tmp;
00206       
00207 //       digiMap[chambId].push_back((*digiIt));
00208 //     }
00209   }
00210 
00211   // CB the commented because we don't use config()->debug() anymore in future will probably be possible to avoid the digis sorting  
00212 //   if(config()->debug()>2){
00213 //     std::cout << "----------DTDigis ordered by chamber:" << std::endl;
00214 //     for (DTDigiMap_const_iterator digiMapIt=digiMap.begin();
00215 //       digiMapIt!=digiMap.end();
00216 //       digiMapIt++){
00217 //       DTChamberId chambId = (*digiMapIt).first;
00218 //       DTDigiCollection digis = (*digiMapIt).second;
00219 //       std::cout << "Chamber id   " << chambId << std::endl;
00220 //       DTDigiCollection::DigiRangeIterator RangeIt;
00221 //       for (RangeIt=digis.begin();
00222 //         RangeIt!=digis.end();
00223 //         RangeIt++){
00224 //      std::cout << "Digi's layer   " << (*RangeIt).first << std::endl;
00225 //      const DTDigiCollection::Range& range = (*RangeIt).second;
00226 //      for (DTDigiCollection::const_iterator digiIt = range.first;
00227 //           digiIt!=range.second;
00228 //           ++digiIt){
00229 //        std::cout << "Digi's data   " << (*digiIt) << std::endl; 
00230 //      }
00231         
00232         
00233 //       }
00234 //     }
00235 //   }
00236   
00237   //Run reconstruct for single trigger subsystem (Bti, Traco TS)
00238   for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
00239     DTSCTrigUnit* thisTU=(*it).second;
00240     if (thisTU->BtiTrigs()->size()>0){
00241       thisTU->BtiTrigs()->clearCache();
00242       thisTU->TSThTrigs()->clearCache();
00243       thisTU->TracoTrigs()->clearCache();
00244       thisTU->TSPhTrigs()->clearCache();
00245     }
00246     DTChamberId chid=thisTU->statId();
00247     DTDigiMap_iterator dmit = digiMap.find(chid);
00248     if (dmit !=digiMap.end()){
00249       thisTU->BtiTrigs()->reconstruct((*dmit).second); 
00250       if(thisTU->BtiTrigs()->size()>0){
00251         thisTU->TSThTrigs()->reconstruct();
00252         thisTU->TracoTrigs()->reconstruct();
00253         if(thisTU->TracoTrigs()->size()>0)
00254           thisTU->TSPhTrigs()->reconstruct();
00255       }
00256     }
00257   }
00258   //Run reconstruct for Sector Collector
00259   for (SC_iterator it=_cache1.begin();it!=_cache1.end();it++){
00260     DTSectColl* sectcoll = (*it).second;
00261     DTSectCollId scid = (*it).first;
00262     if (sectcoll->sizePh()>0 || sectcoll->sizeTh()>0)
00263       sectcoll->clearCache();
00264     bool mustreco = false;
00265     for (int i=1;i<5;i++) {
00266       if (sectcoll->getTSPhi(i)->size()>0) {
00267         mustreco = true;
00268         break;
00269       }
00270     }
00271     for (int i=1;i<4;i++) {
00272       if (sectcoll->getTSTheta(i)->size()>0) {
00273         mustreco = true;
00274         break;
00275       }
00276     }
00277     if (scid.sector()==4 || scid.sector()==10){
00278       if (sectcoll->getTSPhi(5)->size()>0)
00279         mustreco = true;
00280     }
00281     if (mustreco)
00282       sectcoll->reconstruct();
00283   }
00284 
00285 }
00286 
00287 void
00288 DTTrig::updateES(const edm::EventSetup& iSetup){
00289 
00290   // Check for updatets in config
00291   edm::ESHandle<DTConfigManager> confHandle;
00292   edm::ESHandle<DTGeometry> geomHandle;
00293   edm::ESHandle<DTT0> t0Handle;
00294   edm::ESHandle<DTTtrig> ttrigHandle;
00295 
00296   if (iSetup.get<DTConfigManagerRcd>().cacheIdentifier()!=_configid) {
00297     
00298     if (_debug)
00299     std::cout << "DTTrig::updateES updating DTTPG configuration" << std::endl;
00300     
00301     _configid = iSetup.get<DTConfigManagerRcd>().cacheIdentifier();
00302     iSetup.get<DTConfigManagerRcd>().get(confHandle);
00303     _conf_manager = confHandle.product();
00304     for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
00305       (*it).second->setConfig(_conf_manager);
00306     }
00307     for (SC_iterator it=_cache1.begin();it!=_cache1.end();it++){
00308     (*it).second->setConfig(_conf_manager);
00309     }
00310 
00311   }
00312 
00313   if (iSetup.get<MuonGeometryRecord>().cacheIdentifier()!=_configid) {
00314 
00315     if (_debug)
00316     std::cout << "DTTrig::updateES updating muon geometry" << std::endl;
00317 
00318     _geomid = iSetup.get<MuonGeometryRecord>().cacheIdentifier();
00319     iSetup.get<MuonGeometryRecord>().get(geomHandle);
00320     for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
00321       (*it).second->setGeom(geomHandle->chamber((*it).second->statId()));
00322     }
00323 
00324   }
00325 
00326   if (_usesyncdb &&
00327       (iSetup.get<DTT0Rcd>().cacheIdentifier()!=_t0id || 
00328       iSetup.get<DTTtrigRcd>().cacheIdentifier()!=_ttrigid)) {
00329 
00330     if (_debug)
00331     std::cout << "DTTrig::updateES updating synchronizer" << std::endl;
00332 
00333     _t0id    = iSetup.get<DTT0Rcd>().cacheIdentifier();
00334     _ttrigid = iSetup.get<DTTtrigRcd>().cacheIdentifier();
00335     _digi_sync->setES(iSetup);
00336 
00337   }
00338 
00339 } 
00340 
00341 
00342 void
00343 DTTrig::clear() {
00344   // Delete the map
00345   for (TU_iterator it=_cache.begin();it!=_cache.end();it++){
00346     // Delete all the trigger units 
00347     delete (*it).second;
00348   }
00349   _cache.clear(); 
00350 
00351   for (SC_iterator it=_cache1.begin();it!=_cache1.end();it++){
00352     // Delete all the Sector Collectors
00353     delete (*it).second;
00354   }
00355   _cache1.clear();
00356 
00357 }
00358 
00359 DTSCTrigUnit*
00360 DTTrig::trigUnit(DTChamberId chid) {
00361   /*check();*/  return constTrigUnit(chid);
00362 
00363 }
00364 
00365 
00366 
00367 DTSCTrigUnit*
00368 DTTrig::constTrigUnit(DTChamberId chid) const {
00369 //    std::cout << " SC: running DTTrig::constTrigUnit(DTChamberId chid)" << std::endl;
00370   TU_const_iterator it = _cache.find(chid);
00371   if ( it == _cache.end()) {
00372     std::cout << "DTTrig::trigUnit: Trigger Unit not in the map: ";
00373     std::cout << " wheel=" << chid.wheel() ;
00374     std::cout << ", station=" << chid.station();
00375     std::cout << ", sector=" << chid.sector();
00376     std::cout << std::endl;
00377     return 0;
00378   }
00379 
00380   return (*it).second;
00381 }
00382 
00383 DTSectColl*
00384 DTTrig::SCUnit(DTSectCollId scid) const {
00385 SC_const_iterator it = _cache1.find(scid);
00386   if ( it == _cache1.end()) {
00387     std::cout << "DTTrig::SCUnit: Trigger Unit not in the map: ";
00388     std::cout << " wheel=" << scid.wheel() ;
00389     std::cout << ", sector=" << scid.sector();
00390     std::cout << std::endl;
00391     return 0;
00392   }
00393 
00394   return (*it).second;
00395 }
00396 
00397 DTSCTrigUnit*
00398 DTTrig::trigUnit(int wheel, int stat, int sect) {
00399   return constTrigUnit(wheel, stat, sect);
00400 }
00401 
00402 DTSectColl*
00403 DTTrig::SCUnit(int wheel, int sect) const {
00404   sect++;
00405   return SCUnit(DTSectCollId(wheel,sect));
00406 }
00407 
00408 
00409 DTSCTrigUnit*
00410 DTTrig::constTrigUnit(int wheel, int stat, int sect) const {
00411   sect++;   // offset 1 for sector number ([0,11] --> [1,12])
00412   return constTrigUnit(DTChamberId(wheel,stat,sect));
00413 
00414 }
00415 
00416 
00417 DTChambPhSegm* 
00418 DTTrig::chPhiSegm1(DTSCTrigUnit* unit, int step) {
00419   if(unit==0)return 0;
00420   if(unit->nPhiSegm(step)<1)return 0;
00421   return const_cast<DTChambPhSegm*>(unit->phiSegment(step,1));
00422 }
00423 
00424 DTChambPhSegm* 
00425 DTTrig::chPhiSegm2(DTSCTrigUnit* unit, int step) {
00426   if(unit==0)return 0;
00427   if(unit->nPhiSegm(step)<2)return 0;
00428   return const_cast<DTChambPhSegm*>(unit->phiSegment(step,2));
00429 }
00430 
00431 DTChambThSegm* 
00432 DTTrig::chThetaSegm(DTSCTrigUnit* unit, int step) {
00433   if(unit==0)return 0;
00434   if(unit->nThetaSegm(step)<1)return 0;
00435   return const_cast<DTChambThSegm*>(unit->thetaSegment(step,1));
00436 }
00437 
00438 DTChambPhSegm* 
00439 DTTrig::chPhiSegm1(DTChamberId sid, int step) {
00440   return chPhiSegm1(trigUnit(sid),step);
00441 }
00442 
00443 DTChambPhSegm* 
00444 DTTrig::chPhiSegm2(DTChamberId sid, int step) {
00445   return chPhiSegm2(trigUnit(sid),step);
00446 }
00447 
00448 DTChambThSegm* 
00449 DTTrig::chThetaSegm(DTChamberId sid, int step) {
00450   if(sid.station()==4)return 0;
00451   return chThetaSegm(trigUnit(sid),step);
00452 }
00453 
00454 DTChambPhSegm*
00455 DTTrig::chPhiSegm1(int wheel, int stat, int sect, int step) {
00456    return chPhiSegm1(trigUnit(wheel,stat,sect),step);
00457   // to make it transparent to the outside world
00458   //  return chSectCollSegm1(wheel,stat,sect,step);
00459 
00460 }
00461 
00462 DTChambPhSegm* 
00463 DTTrig::chPhiSegm2(int wheel, int stat, int sect, int step) {
00464   //  if(stat==4&&(sect==3||sect==9)) {
00465   // if hrizontal chambers of MB4 get first track of twin chamber (flag=1)
00466   //   return chPhiSegm1(trigUnit(wheel,stat,sect,1),step);
00467   //  } else {
00468     return chPhiSegm2(trigUnit(wheel,stat,sect),step);
00469   // to make it transparent to the outside world
00470   // return chSectCollSegm2(wheel,stat,sect,step);
00471   //}
00472 }
00473 
00474 DTChambThSegm* 
00475 DTTrig::chThetaSegm(int wheel, int stat, int sect, int step) {
00476   if(stat==4)return 0;
00477   return chThetaSegm(trigUnit(wheel,stat,sect),step);
00478 }
00479 
00480 // SM sector collector section
00481 DTSectCollPhSegm* 
00482 DTTrig::chSectCollPhSegm1(DTSectColl* unit, int step) {
00483 
00484   if(unit==0)return 0;
00485    if(unit->nSegmPh(step)<1)return 0;
00486    return const_cast<DTSectCollPhSegm*>(unit->SectCollPhSegment(step,1));
00487 }
00488 
00489 DTSectCollPhSegm* 
00490 DTTrig::chSectCollPhSegm2(DTSectColl* unit, int step) {
00491   if(unit==0)return 0;
00492     if(unit->nSegmPh(step)<2)return 0;
00493   return const_cast<DTSectCollPhSegm*>(unit->SectCollPhSegment(step,2));
00494 }
00495 
00496 
00497 DTSectCollPhSegm*
00498 DTTrig::chSectCollPhSegm1(int wheel, int sect, int step) {
00499 
00500   return chSectCollPhSegm1(SCUnit(wheel,sect),step);
00501 }
00502 
00503 DTSectCollPhSegm* 
00504 DTTrig::chSectCollPhSegm2(int wheel, int sect, int step) {
00505   //  if(stat==4&&(sect==3||sect==9)) {
00506     // if hrizontal chambers of MB4 get first track of twin chamber (flag=1)
00507   //return chSectCollSegm1(trigUnit(wheel,stat,sect,1),step);
00508   //} else {
00509     return chSectCollPhSegm2(SCUnit(wheel,sect),step);
00510     //}
00511 }
00512 
00513 DTSectCollThSegm* 
00514 DTTrig::chSectCollThSegm(DTSectColl* unit, int step) {
00515 
00516   if(unit==0)return 0;
00517    if(unit->nSegmTh(step)<1)return 0;
00518   return const_cast<DTSectCollThSegm*>(unit->SectCollThSegment(step));
00519 }
00520 
00521 DTSectCollThSegm*
00522 DTTrig::chSectCollThSegm(int wheel, int sect, int step) {
00523 
00524   return chSectCollThSegm(SCUnit(wheel,sect),step);
00525 }
00526 
00527   // end SM
00528 
00529 
00530 void 
00531 DTTrig::dumpGeom() {
00532   /*check();*/
00533   for (TU_const_iterator it=_cache.begin();it!=_cache.end();it++){
00534     ((*it).second)->dumpGeom();
00535   }
00536 }
00537 
00538 std::vector<DTBtiTrigData> 
00539 DTTrig::BtiTrigs() {
00540   /*check();*/
00541   std::vector<DTBtiTrigData> trigs;
00542   TU_iterator ptu;
00543   for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
00544     DTSCTrigUnit* tu = (*ptu).second;
00545     std::vector<DTBtiTrigData>::const_iterator p; //p=0;
00546     std::vector<DTBtiTrigData>::const_iterator peb=tu->BtiTrigs()->end();
00547     for(p=tu->BtiTrigs()->begin();p!=peb;p++){
00548       trigs.push_back(*p);
00549     }
00550   }
00551   return trigs;
00552 }
00553 
00554 std::vector<DTTracoTrigData> 
00555 DTTrig::TracoTrigs()  {
00556   std::vector<DTTracoTrigData> trigs;
00557   TU_iterator ptu;
00558   /*check();*/
00559   for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
00560     DTSCTrigUnit* tu = (*ptu).second;
00561     std::vector<DTTracoTrigData>::const_iterator p; //p=0;
00562     std::vector<DTTracoTrigData>::const_iterator peb=tu->TracoTrigs()->end();
00563     for(p=tu->TracoTrigs()->begin();p!=peb;p++){
00564       trigs.push_back(*p);
00565     }
00566   }
00567   return trigs;
00568 }
00569 
00570 std::vector<DTChambPhSegm> 
00571 DTTrig::TSPhTrigs()  {
00572   /*check();*/
00573   std::vector<DTChambPhSegm> trigs;
00574   TU_iterator ptu;
00575   for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
00576     DTSCTrigUnit* tu = (*ptu).second;
00577     std::vector<DTChambPhSegm>::const_iterator p; //p=0;
00578     std::vector<DTChambPhSegm>::const_iterator peb=tu->TSPhTrigs()->end();
00579     for(p=tu->TSPhTrigs()->begin();p!=peb;p++){
00580       trigs.push_back(*p);
00581     }
00582   }
00583   return trigs;
00584 }
00585 
00586 std::vector<DTChambThSegm> 
00587 DTTrig::TSThTrigs()  {
00588   /*check();*/
00589   std::vector<DTChambThSegm> trigs;
00590   TU_iterator ptu;
00591   for(ptu=_cache.begin();ptu!=_cache.end();ptu++) {
00592     DTSCTrigUnit* tu = (*ptu).second;
00593     std::vector<DTChambThSegm>::const_iterator p; //p=0;
00594     std::vector<DTChambThSegm>::const_iterator peb=tu->TSThTrigs()->end();
00595     for(p=tu->TSThTrigs()->begin();p!=peb;p++){
00596       trigs.push_back(*p);
00597     }
00598   }
00599   return trigs;
00600 }
00601 
00602 std::vector<DTSectCollPhSegm> 
00603 DTTrig::SCPhTrigs()  {
00604   /*check();*/
00605   std::vector<DTSectCollPhSegm> trigs;
00606   //  SC_iterator ptu;
00607   SC_iterator psc;
00608   for(psc=_cache1.begin();psc!=_cache1.end();psc++) {
00609     //    DTSCTrigUnit* tu = (*ptu).second;
00610     //
00611     // old SMDB:    
00612     //      DTSectColl* tu = (*ptu).second;
00613     //      std::vector<DTChambPhSegm>::const_iterator p=0;
00614     //      std::vector<DTChambPhSegm>::const_iterator peb=tu->SCTrigs()->end();
00615     //      for(p=tu->SCTrigs()->begin();p!=peb;p++){
00616     //        trigs.push_back(*p);
00617     //      } 
00618 
00619     DTSectColl* sc = (*psc).second;
00620     std::vector<DTSectCollPhSegm>::const_iterator p;
00621     std::vector<DTSectCollPhSegm>::const_iterator peb=sc->endPh();
00622     for(p=sc->beginPh();p!=peb;p++){
00623       trigs.push_back(*p);
00624     }
00625 
00626   }
00627   return trigs;
00628 }
00629 
00630 
00631 std::vector<DTSectCollThSegm> 
00632 DTTrig::SCThTrigs()  {
00633   /*check();*/
00634   std::vector<DTSectCollThSegm> trigs;
00635   SC_iterator psc;
00636   for(psc=_cache1.begin();psc!=_cache1.end();psc++) {
00637     DTSectColl* sc = (*psc).second;
00638     std::vector<DTSectCollThSegm>::const_iterator p; //p=0;
00639     std::vector<DTSectCollThSegm>::const_iterator peb=sc->endTh();
00640     for(p=sc->beginTh();p!=peb;p++){
00641       trigs.push_back(*p);
00642     }
00643 
00644   }
00645   return trigs;
00646 }

Generated on Tue Jun 9 17:40:02 2009 for CMSSW by  doxygen 1.5.4