CMS 3D CMS Logo

DTConfigTrivialProducer Class Reference

Description: A Producer for the DT config available via EventSetup. More...

#include <L1TriggerConfig/DTTPGConfigProducers/interface/DTConfigTrivialProducer.h>

Inheritance diagram for DTConfigTrivialProducer:

edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

void buildManager ()
 DTConfigTrivialProducer (const edm::ParameterSet &)
std::auto_ptr< DTConfigManagerproduce (const DTConfigManagerRcd &)
 ~DTConfigTrivialProducer ()

Private Member Functions

std::string mapEntryName (const DTChamberId &chambid) const

Private Attributes

DTConfigManagerm_manager
edm::ParameterSet m_ps


Detailed Description

Description: A Producer for the DT config available via EventSetup.

Implementation: <Notes on="" implementation>="">

Definition at line 42 of file DTConfigTrivialProducer.h.


Constructor & Destructor Documentation

DTConfigTrivialProducer::DTConfigTrivialProducer ( const edm::ParameterSet ps  ) 

Definition at line 24 of file DTConfigTrivialProducer.cc.

References m_manager, m_ps, and edm::ESProducer::setWhatProduced().

00025 {
00026  
00027   //the following line is needed to tell the framework what
00028   // data is being produced
00029   setWhatProduced(this);
00030 
00031   //now do what ever other initialization is needed
00032   
00033   //get and store parameter set 
00034   m_ps = ps;
00035   m_manager = new DTConfigManager();
00036 }

DTConfigTrivialProducer::~DTConfigTrivialProducer (  ) 

Definition at line 39 of file DTConfigTrivialProducer.cc.

00040 {
00041  
00042    // do anything here that needs to be done at destruction time
00043    // (e.g. close files, deallocate resources etc.)
00044 
00045 }


Member Function Documentation

void DTConfigTrivialProducer::buildManager (  ) 

Definition at line 63 of file DTConfigTrivialProducer.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_manager, m_ps, mapEntryName(), DTChamberId::sector(), DTConfigManager::setDTConfigBti(), DTConfigManager::setDTConfigSectColl(), DTConfigManager::setDTConfigTraco(), DTConfigManager::setDTConfigTrigUnit(), DTConfigManager::setDTConfigTSPhi(), DTConfigManager::setDTConfigTSTheta(), DTConfigManager::setDTTPGDebug(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by produce().

00064 {
00065 
00066   //create config classes&C.
00067   edm::ParameterSet conf_ps = m_ps.getParameter<edm::ParameterSet>("DTTPGParameters");
00068   edm::ParameterSet conf_map = m_ps.getUntrackedParameter<edm::ParameterSet>("DTTPGMap");
00069   bool dttpgdebug = conf_ps.getUntrackedParameter<bool>("Debug");
00070   DTConfigSectColl sectcollconf(conf_ps.getParameter<edm::ParameterSet>("SectCollParameters"));
00071   edm::ParameterSet tups = conf_ps.getParameter<edm::ParameterSet>("TUParameters");
00072   DTConfigBti bticonf(tups.getParameter<edm::ParameterSet>("BtiParameters"));
00073   DTConfigTraco tracoconf(tups.getParameter<edm::ParameterSet>("TracoParameters"));
00074   DTConfigTSTheta tsthetaconf(tups.getParameter<edm::ParameterSet>("TSThetaParameters"));
00075   DTConfigTSPhi tsphiconf(tups.getParameter<edm::ParameterSet>("TSPhiParameters"));
00076   DTConfigTrigUnit trigunitconf(tups);
00077   
00078   m_manager->setDTTPGDebug(dttpgdebug);
00079 
00080   for (int iwh=-2;iwh<=2;++iwh){
00081     for (int ist=1;ist<=4;++ist){
00082       for (int ise=1;ise<=12;++ise){
00083         DTChamberId chambid(iwh,ist,ise);
00084         vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(mapEntryName(chambid).c_str());
00085 //      std::cout << "  untracked vint32 wh" << chambid.wheel()
00086 //                << "st" << chambid.station()
00087 //                << "se" << chambid.sector() << " = { ";
00088         if(dttpgdebug)
00089           {
00090             std::cout << " Filling configuration for chamber : wh " << chambid.wheel() << 
00091               ", st " << chambid.station() << 
00092               ", se " << chambid.sector() << endl;
00093           }
00094         
00095         //fill the bti map
00096         for (int isl=1;isl<=3;isl++){
00097           int ncell = nmap[isl-1];
00098           //      std::cout << ncell <<" , ";
00099           for (int ibti=0;ibti<ncell;ibti++)
00100             {
00101               m_manager->setDTConfigBti(DTBtiId(chambid,isl,ibti+1),bticonf);
00102               if(dttpgdebug)
00103                 std::cout << "Filling BTI config for chamber : wh " << chambid.wheel() << 
00104                   ", st " << chambid.station() << 
00105                   ", se " << chambid.sector() << 
00106                   "... sl " << isl << 
00107                   ", bti " << ibti+1 << endl;
00108             }     
00109         }
00110         
00111         // fill the traco map
00112         int ntraco = nmap[3];
00113         //std::cout << ntraco << " }" << std::endl;
00114         for (int itraco=0;itraco<ntraco;itraco++)
00115           { 
00116             m_manager->setDTConfigTraco(DTTracoId(chambid,itraco+1),tracoconf);
00117             if(dttpgdebug)
00118               std::cout << "Filling TRACO config for chamber : wh " << chambid.wheel() << 
00119                 ", st " << chambid.station() << 
00120                 ", se " << chambid.sector() << 
00121                 ", traco " << itraco+1 << endl;
00122           }     
00123         
00124         // fill TS & TrigUnit
00125         m_manager->setDTConfigTSTheta(chambid,tsthetaconf);
00126         m_manager->setDTConfigTSPhi(chambid,tsphiconf);
00127         m_manager->setDTConfigTrigUnit(chambid,trigunitconf);
00128         
00129       }
00130     }
00131   }
00132 
00133   for (int iwh=-2;iwh<=2;++iwh){
00134     for (int ise=13;ise<=14;++ise){
00135       int ist =4;
00136       DTChamberId chambid(iwh,ist,ise);
00137       vector<int> nmap = conf_map.getUntrackedParameter<vector<int> >(mapEntryName(chambid).c_str());
00138 //       std::cout << "  untracked vint32 wh" << chambid.wheel()
00139 //              << "st" << chambid.station()
00140 //              << "se" << chambid.sector() << " = { ";
00141       if(dttpgdebug)
00142         {
00143           std::cout << " Filling configuration for chamber : wh " << chambid.wheel() << 
00144             ", st " << chambid.station() << 
00145             ", se " << chambid.sector() << endl;
00146         }
00147       
00148       //fill the bti map
00149       for (int isl=1;isl<=3;isl++){
00150         int ncell = nmap[isl-1];
00151 //      std::cout << ncell <<" , ";
00152         for (int ibti=0;ibti<ncell;ibti++)
00153           {
00154             m_manager->setDTConfigBti(DTBtiId(chambid,isl,ibti+1),bticonf);
00155             if(dttpgdebug)
00156               std::cout << "Filling BTI config for chamber : wh " << chambid.wheel() << 
00157                 ", st " << chambid.station() << 
00158                 ", se " << chambid.sector() << 
00159                 "... sl " << isl << 
00160                 ", bti " << ibti+1 << endl;
00161           }     
00162       }
00163       
00164       // fill the traco map
00165       int ntraco = nmap[3];
00166 //       std::cout << ntraco << " }" << std::endl;
00167       for (int itraco=0;itraco<ntraco;itraco++)
00168         { 
00169           m_manager->setDTConfigTraco(DTTracoId(chambid,itraco+1),tracoconf);
00170           if(dttpgdebug)
00171             std::cout << "Filling TRACO config for chamber : wh " << chambid.wheel() << 
00172               ", st " << chambid.station() << 
00173               ", se " << chambid.sector() << 
00174               ", traco " << itraco+1 << endl;
00175         }     
00176       
00177       // fill TS & TrigUnit
00178       m_manager->setDTConfigTSTheta(chambid,tsthetaconf);
00179       m_manager->setDTConfigTSPhi(chambid,tsphiconf);
00180       m_manager->setDTConfigTrigUnit(chambid,trigunitconf);
00181       
00182     }
00183   }
00184   
00185   //loop on Sector Collectors
00186   for (int wh=-2;wh<=2;wh++)
00187     for (int se=1;se<=12;se++)
00188       m_manager->setDTConfigSectColl(DTSectCollId(wh,se),sectcollconf);
00189 
00190 }

std::string DTConfigTrivialProducer::mapEntryName ( const DTChamberId chambid  )  const [private]

Definition at line 193 of file DTConfigTrivialProducer.cc.

References DTChamberId::sector(), DTChamberId::station(), and DTChamberId::wheel().

Referenced by buildManager().

00194 {
00195   int iwh = chambid.wheel();
00196   std::ostringstream os;
00197   os << "wh";
00198   if (iwh < 0) {
00199      os << 'm' << -iwh;
00200    } else {
00201      os << iwh;
00202   }
00203   os << "st" << chambid.station() << "se" << chambid.sector();
00204   return os.str();
00205 }

std::auto_ptr< DTConfigManager > DTConfigTrivialProducer::produce ( const DTConfigManagerRcd iRecord  ) 

Definition at line 52 of file DTConfigTrivialProducer.cc.

References buildManager(), and m_manager.

00053 {
00054    using namespace edm::es;
00055 
00056    buildManager();
00057 
00058    std::auto_ptr<DTConfigManager> dtConfig = std::auto_ptr<DTConfigManager>( m_manager );
00059 
00060    return dtConfig ;
00061 }


Member Data Documentation

DTConfigManager* DTConfigTrivialProducer::m_manager [private]

Definition at line 55 of file DTConfigTrivialProducer.h.

Referenced by buildManager(), DTConfigTrivialProducer(), and produce().

edm::ParameterSet DTConfigTrivialProducer::m_ps [private]

Definition at line 54 of file DTConfigTrivialProducer.h.

Referenced by buildManager(), and DTConfigTrivialProducer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:48 2009 for CMSSW by  doxygen 1.5.4