CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

RPCTriggerConfig Class Reference

Inheritance diagram for RPCTriggerConfig:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef std::auto_ptr
< L1RPCConfig
ReturnType

Public Member Functions

ReturnType produce (const L1RPCConfigRcd &)
 RPCTriggerConfig (const edm::ParameterSet &)
 ~RPCTriggerConfig ()

Private Attributes

std::string m_patternsDir
int m_ppt

Detailed Description

Description: <one line="" class="" summary>="">

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

Definition at line 44 of file RPCTriggerConfig.cc.


Member Typedef Documentation

typedef std::auto_ptr<L1RPCConfig> RPCTriggerConfig::ReturnType

Definition at line 49 of file RPCTriggerConfig.cc.


Constructor & Destructor Documentation

RPCTriggerConfig::RPCTriggerConfig ( const edm::ParameterSet iConfig)

Definition at line 70 of file RPCTriggerConfig.cc.

References edm::ParameterSet::getUntrackedParameter(), m_patternsDir, m_ppt, and edm::ESProducer::setWhatProduced().

{
   //the following line is needed to tell the framework what
   // data is being produced
   setWhatProduced(this);

   //now do what ever other initialization is needed


   m_ppt = iConfig.getUntrackedParameter<int>("PACsPerTower");
   std::string dataDir = iConfig.getUntrackedParameter<std::string>("filedir");
   
   edm::FileInPath fp(dataDir+"pacPat_t0sc0sg0.xml");
   std::string patternsDirNameUnstriped = fp.fullPath();
   m_patternsDir = patternsDirNameUnstriped.substr(0,patternsDirNameUnstriped.find_last_of("/")+1);

  
               

}
RPCTriggerConfig::~RPCTriggerConfig ( )

Definition at line 92 of file RPCTriggerConfig.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

RPCTriggerConfig::ReturnType RPCTriggerConfig::produce ( const L1RPCConfigRcd iRecord)

Definition at line 107 of file RPCTriggerConfig.cc.

References Exception, alignmentValidation::fname, RPCPatternsParser::getPatternsVec(), RPCPatternsParser::getQualityVec(), LogDebug, m_patternsDir, m_ppt, RPCConst::m_TOWER_COUNT, RPCPatternsParser::parse(), and geometryXMLtoCSV::parser.

{
   using namespace edm::es;
   std::auto_ptr<L1RPCConfig> pL1RPCConfig = std::auto_ptr<L1RPCConfig>( new L1RPCConfig() );

   pL1RPCConfig->setPPT(m_ppt);
   
   // parse and isert patterns
   int scCnt = 0, sgCnt = 0;
   if(m_ppt == 1) {
       scCnt = 1;
       sgCnt = 1;
    }
    else if(m_ppt == 12) {
       scCnt = 1;
       sgCnt = 12;
    }
    else if(m_ppt == 144) {
       scCnt = 12;
       sgCnt = 12;
    }
    else {
       throw cms::Exception("BadConfig") << "Bad number of ppt requested: " << m_ppt << "\n";
    }


    for (int tower = 0; tower < RPCConst::m_TOWER_COUNT; ++tower) {
      for (int logSector = 0; logSector < scCnt; ++logSector) {
         for (int logSegment = 0; logSegment < sgCnt; ++logSegment) {
         
            std::stringstream fname;
            fname << m_patternsDir
                  << "pacPat_t" << tower 
                  << "sc"  << logSector 
                  << "sg" <<logSegment 
                  << ".xml";
                  
            // TODO: this should go to logSth
            LogDebug("RPCTriggerConfig") << "Parsing: " << fname.str() <<std::endl;
                  
            RPCPatternsParser parser;
            parser.parse(fname.str());

            RPCPattern::RPCPatVec npats = parser.getPatternsVec(tower, logSector, logSegment);
            for (unsigned int ip=0; ip<npats.size(); ip++) {
              npats[ip].setCoords(tower,logSector,logSegment);
              pL1RPCConfig->m_pats.push_back(npats[ip]);
            }

            RPCPattern::TQualityVec nquals = parser.getQualityVec(); 
            for (unsigned int iq=0; iq<nquals.size(); iq++) {
              nquals[iq].m_tower=tower;
              nquals[iq].m_logsector=logSector;
              nquals[iq].m_logsegment=logSegment;
              pL1RPCConfig->m_quals.push_back(nquals[iq]);
            }
            
            LogDebug("RPCTriggerConfig") 
                      << "  RPCPatterns: " << npats.size() 
                      << " qualities: "<<  nquals.size()
                      << std::endl;
            
         
         } // segments
      } // sectors
    } // towers



   return pL1RPCConfig ;
}

Member Data Documentation

std::string RPCTriggerConfig::m_patternsDir [private]

Definition at line 56 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().

int RPCTriggerConfig::m_ppt [private]

Definition at line 55 of file RPCTriggerConfig.cc.

Referenced by produce(), and RPCTriggerConfig().