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 9 of file EmulateCPPF.h.

Member Enumeration Documentation

enum EmulateCPPF::CppfSource
strongprivate
Enumerator
File 
EventSetup 

Definition at line 29 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.

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

Definition at line 55 of file EmulateCPPF.cc.

55 {}

Member Function Documentation

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

Definition at line 57 of file EmulateCPPF.cc.

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

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

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 30 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

int EmulateCPPF::MaxClusterSize_
private

Definition at line 31 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

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

Definition at line 26 of file EmulateCPPF.h.

Referenced by process().

const edm::EDGetToken EmulateCPPF::recHitToken_
private

Definition at line 28 of file EmulateCPPF.h.

Referenced by process().