CMS 3D CMS Logo

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