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_
 
const edm::EDGetToken rpcDigiSimLinkToken_
 
const edm::EDGetToken rpcDigiToken_
 
const edm::ESGetToken< RPCGeometry, MuonGeometryRecordrpcGeomToken_
 

Detailed Description

Definition at line 10 of file EmulateCPPF.h.

Member Enumeration Documentation

◆ CppfSource

enum EmulateCPPF::CppfSource
strongprivate
Enumerator
File 
EventSetup 

Definition at line 33 of file EmulateCPPF.h.

Constructor & Destructor Documentation

◆ EmulateCPPF()

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

Definition at line 14 of file EmulateCPPF.cc.

References L1TStage2CPPF_cfi::cppfSource, cppfSource_, CppfVec_1, EventSetup, Exception, beamvalidation::exit(), File, personalPlayback::fp, edm::ParameterSet::getParameter(), RecHitProcessor::CppfItem::halfchannel, recoMuon::in, makeListRunsInFiles::inputFile, RecHitProcessor::CppfItem::int_phi, RecHitProcessor::CppfItem::int_theta, RecHitProcessor::CppfItem::lb, MaxClusterSize_, RecHitProcessor::CppfItem::rawId, AlCaHLTBitMon_QueryRunRegistry::string, and RecHitProcessor::CppfItem::strip.

16  rpcDigiToken_(iConsumes.consumes<RPCDigiCollection>(iConfig.getParameter<edm::InputTag>("rpcDigiLabel"))),
17  recHitToken_(iConsumes.consumes<RPCRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitLabel"))),
19  iConfig.getParameter<edm::InputTag>("rpcDigiSimLinkLabel"))),
20  rpcGeomToken_(iConsumes.esConsumes()),
22  MaxClusterSize_(0) {
23  MaxClusterSize_ = iConfig.getParameter<int>("MaxClusterSize");
24  const std::string cppfSource = iConfig.getParameter<std::string>("cppfSource");
25  // Look up table
26  if (cppfSource == "File") {
28  edm::FileInPath fp = iConfig.getParameter<edm::FileInPath>("cppfvecfile");
29  std::ifstream inputFile(fp.fullPath().c_str(), std::ios::in);
30  if (!inputFile) {
31  throw cms::Exception("No LUT") << "Error: CPPF look up table file cannot not be opened";
32  exit(1);
33  }
34  while (inputFile.good()) {
36  inputFile >> Item.rawId >> Item.strip >> Item.lb >> Item.halfchannel >> Item.int_phi >> Item.int_theta;
37  if (inputFile.good())
38  CppfVec_1.push_back(Item);
39  }
40  inputFile.close();
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 table or 'Geo' for RPC Geometry";
50  exit(1);
51  }
52 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetToken rpcDigiToken_
Definition: EmulateCPPF.h:28
std::array< RecHitProcessor, 1 > recHit_processors_
Definition: EmulateCPPF.h:26
enum EmulateCPPF::CppfSource cppfSource_
int MaxClusterSize_
Definition: EmulateCPPF.h:35
std::vector< RecHitProcessor::CppfItem > CppfVec_1
Definition: EmulateCPPF.h:34
const edm::EDGetToken recHitToken_
Definition: EmulateCPPF.h:29
const edm::EDGetToken rpcDigiSimLinkToken_
Definition: EmulateCPPF.h:30
const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeomToken_
Definition: EmulateCPPF.h:31
def exit(msg="")

◆ ~EmulateCPPF()

EmulateCPPF::~EmulateCPPF ( )

Definition at line 54 of file EmulateCPPF.cc.

54 {}

Member Function Documentation

◆ process()

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

Definition at line 56 of file EmulateCPPF.cc.

References cppfSource_, CppfVec_1, EventSetup, File, iEvent, MaxClusterSize_, recHit_processors_, recHitToken_, rpcDigiSimLinkToken_, rpcDigiToken_, and rpcGeomToken_.

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

Member Data Documentation

◆ cppfSource_

enum EmulateCPPF::CppfSource EmulateCPPF::cppfSource_
private

Referenced by EmulateCPPF(), and process().

◆ CppfVec_1

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

Definition at line 34 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

◆ MaxClusterSize_

int EmulateCPPF::MaxClusterSize_
private

Definition at line 35 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

◆ recHit_processors_

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

Definition at line 26 of file EmulateCPPF.h.

Referenced by process().

◆ recHitToken_

const edm::EDGetToken EmulateCPPF::recHitToken_
private

Definition at line 29 of file EmulateCPPF.h.

Referenced by process().

◆ rpcDigiSimLinkToken_

const edm::EDGetToken EmulateCPPF::rpcDigiSimLinkToken_
private

Definition at line 30 of file EmulateCPPF.h.

Referenced by process().

◆ rpcDigiToken_

const edm::EDGetToken EmulateCPPF::rpcDigiToken_
private

Definition at line 28 of file EmulateCPPF.h.

Referenced by process().

◆ rpcGeomToken_

const edm::ESGetToken<RPCGeometry, MuonGeometryRecord> EmulateCPPF::rpcGeomToken_
private

Definition at line 31 of file EmulateCPPF.h.

Referenced by process().