CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
EmulateCPPF Class Reference

#include <EmulateCPPF.h>

Public Member Functions

 EmulateCPPF (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iConsumes)
 
void process (const edm::Event &iEvent, const edm::EventSetup &iSetup, l1t::CPPFDigiCollection &cppf_recHit)
 
 ~EmulateCPPF ()
 

Private Types

enum  CppfSource { CppfSource::File, CppfSource::EventSetup }
 

Private Attributes

enum EmulateCPPF::CppfSource cppfSource_
 
std::vector< RecHitProcessor::CppfItemCppfVec_1
 
int MaxClusterSize_
 
std::array< RecHitProcessor, 1 > recHit_processors_
 
const edm::EDGetToken recHitToken_
 

Detailed Description

Definition at line 10 of file EmulateCPPF.h.

Member Enumeration Documentation

enum EmulateCPPF::CppfSource
strongprivate
Enumerator
File 
EventSetup 

Definition at line 31 of file EmulateCPPF.h.

enum EmulateCPPF::CppfSource cppfSource_
Definition: File.h:11

Constructor & Destructor Documentation

EmulateCPPF::EmulateCPPF ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iConsumes 
)
explicit

Definition at line 8 of file EmulateCPPF.cc.

References cppfSource_, CppfVec_1, EventSetup, Exception, cmsRelvalreport::exit, File, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), RecHitProcessor::CppfItem::halfchannel, recoMuon::in, analyzePatCleaning_cfg::inputFile, RecHitProcessor::CppfItem::int_phi, RecHitProcessor::CppfItem::int_theta, RecHitProcessor::CppfItem::lb, MaxClusterSize_, RecHitProcessor::CppfItem::rawId, AlCaHLTBitMon_QueryRunRegistry::string, and RecHitProcessor::CppfItem::strip.

8  :
9  // rpcDigi_processors_(),
11  // rpcDigiToken_( iConsumes.consumes<RPCTag::digi_collection>(iConfig.getParameter<edm::InputTag>("recHitLabel")) ),
12  recHitToken_(iConsumes.consumes<RPCRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitLabel"))),
15 {
16  MaxClusterSize_ = iConfig.getParameter<int>("MaxClusterSize");
17 
18  const std::string cppfSource = iConfig.getParameter<std::string>("cppfSource");
19  //Look up table
20  if (cppfSource == "File"){
22  edm::FileInPath fp = iConfig.getParameter<edm::FileInPath>("cppfvecfile");
23  std::ifstream inputFile(fp.fullPath().c_str(), std::ios::in);
24  if ( !inputFile ) {
25  throw cms::Exception("No LUT") << "Error: CPPF look up table file cannot not be opened";
26  exit(1);
27  }
28  while ( inputFile.good() ) {
30  inputFile >> Item.rawId >> Item.strip >> Item.lb >> Item.halfchannel >> Item.int_phi >> Item.int_theta;
31  if ( inputFile.good() ) CppfVec_1.push_back(Item);
32  }
33  inputFile.close();
34  }
35 
36  //RPC Geometry
37  else if (cppfSource == "Geo") {
39  }
40  //Error for wrong input
41  else {
42  throw cms::Exception("Invalid option") << "Error: Specify in python/emulatorCppfDigis_cfi 'File' for look up table or 'Geo' for RPC Geometry";
43  exit(1);
44  }
45 
46 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::array< RecHitProcessor, 1 > recHit_processors_
Definition: EmulateCPPF.h:28
enum EmulateCPPF::CppfSource cppfSource_
int MaxClusterSize_
Definition: EmulateCPPF.h:33
std::vector< RecHitProcessor::CppfItem > CppfVec_1
Definition: EmulateCPPF.h:32
std::string fullPath() const
Definition: FileInPath.cc:197
const edm::EDGetToken recHitToken_
Definition: EmulateCPPF.h:30
EmulateCPPF::~EmulateCPPF ( )

Definition at line 48 of file EmulateCPPF.cc.

48  {
49 }

Member Function Documentation

void EmulateCPPF::process ( const edm::Event iEvent,
const edm::EventSetup iSetup,
l1t::CPPFDigiCollection cppf_recHit 
)

Definition at line 51 of file EmulateCPPF.cc.

References cppfSource_, CppfVec_1, EventSetup, File, MaxClusterSize_, recHit_processors_, and recHitToken_.

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

55  {
56 
58  //Using the look up table to fill the information
59  cppf_recHit.clear();
60  for (auto& recHit_processor : recHit_processors_) {
61  recHit_processor.processLook( iEvent, iSetup, recHitToken_, CppfVec_1, cppf_recHit, MaxClusterSize_);
62  // recHit_processors_.at(recHit_processor).processLook( iEvent, iSetup, recHitToken_, CppfVec_1, cppf_recHit );
63  }
64  }
65  else if (cppfSource_ == CppfSource::EventSetup) {
66  // Clear output collections
67  // cppf_rpcDigi.clear();
68  cppf_recHit.clear();
69 
70  // // Get the RPCDigis from the event
71  // edm::Handle<RPCTag::digi_collection> rpcDigis;
72  // iEvent.getByToken(rpcDigiToken_, rpcDigis);
73 
74  // _________________________________________________________________________________
75  // Run the CPPF clusterization+coordinate conversion algo on RPCDigis and RecHits
76 
77  // For now, treat CPPF as single board
78  // In the future, may want to treat the 4 CPPF boards in each endcap as separate entities
79 
80  // for (unsigned int iBoard = 0; iBoard < rpcDigi_processors_.size(); iBoard++) {
81  // rpcDigi_processors_.at(iBoard).process( iSetup, rpcDigis, cppf_rpcDigi );
82  // }
83  for (auto& recHit_processor : recHit_processors_) {
84  recHit_processor.process( iEvent, iSetup, recHitToken_, cppf_recHit );
85  //recHit_processors_.at(recHit_processor).process( iEvent, iSetup, recHitToken_, cppf_recHit );
86  }
87  }
88 } // End void EmulateCPPF::process()
std::array< RecHitProcessor, 1 > recHit_processors_
Definition: EmulateCPPF.h:28
enum EmulateCPPF::CppfSource cppfSource_
int MaxClusterSize_
Definition: EmulateCPPF.h:33
std::vector< RecHitProcessor::CppfItem > CppfVec_1
Definition: EmulateCPPF.h:32
const edm::EDGetToken recHitToken_
Definition: EmulateCPPF.h:30

Member Data Documentation

enum EmulateCPPF::CppfSource EmulateCPPF::cppfSource_
private

Referenced by EmulateCPPF(), and process().

std::vector<RecHitProcessor::CppfItem> EmulateCPPF::CppfVec_1
private

Definition at line 32 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

int EmulateCPPF::MaxClusterSize_
private

Definition at line 33 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

std::array<RecHitProcessor, 1> EmulateCPPF::recHit_processors_
private

Definition at line 28 of file EmulateCPPF.h.

Referenced by process().

const edm::EDGetToken EmulateCPPF::recHitToken_
private

Definition at line 30 of file EmulateCPPF.h.

Referenced by process().