CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::CppfItem
CppfVec_1
 
int MaxClusterSize_
 
std::array< RecHitProcessor, 1 > recHit_processors_
 
const edm::EDGetToken recHitToken_
 
const edm::EDGetToken rpcDigiSimLinkToken_
 
const edm::EDGetToken rpcDigiToken_
 

Detailed Description

Definition at line 10 of file EmulateCPPF.h.

Member Enumeration Documentation

enum EmulateCPPF::CppfSource
strongprivate
Enumerator
File 
EventSetup 

Definition at line 32 of file EmulateCPPF.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file EmulateCPPF.cc.

References cppfSource_, CppfVec_1, EventSetup, Exception, beamvalidation::exit(), File, personalPlayback::fp, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), RecHitProcessor::CppfItem::halfchannel, recoMuon::in, writeEcalDQMStatus::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"))),
21  MaxClusterSize_(0) {
22  MaxClusterSize_ = iConfig.getParameter<int>("MaxClusterSize");
23  const std::string cppfSource = iConfig.getParameter<std::string>("cppfSource");
24  // Look up table
25  if (cppfSource == "File") {
27  edm::FileInPath fp = iConfig.getParameter<edm::FileInPath>("cppfvecfile");
28  std::ifstream inputFile(fp.fullPath().c_str(), std::ios::in);
29  if (!inputFile) {
30  throw cms::Exception("No LUT") << "Error: CPPF look up table file cannot not be opened";
31  exit(1);
32  }
33  while (inputFile.good()) {
35  inputFile >> Item.rawId >> Item.strip >> Item.lb >> Item.halfchannel >> Item.int_phi >> Item.int_theta;
36  if (inputFile.good())
37  CppfVec_1.push_back(Item);
38  }
39  inputFile.close();
40  }
41  // RPC Geometry
42  else if (cppfSource == "Geo") {
44  }
45  // Error for wrong input
46  else {
47  throw cms::Exception("Invalid option")
48  << "Error: Specify in python/emulatorCppfDigis_cfi 'File' for look up table or 'Geo' for RPC Geometry";
49  exit(1);
50  }
51 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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:34
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< RecHitProcessor::CppfItem > CppfVec_1
Definition: EmulateCPPF.h:33
std::string fullPath() const
Definition: FileInPath.cc:161
const edm::EDGetToken recHitToken_
Definition: EmulateCPPF.h:29
const edm::EDGetToken rpcDigiSimLinkToken_
Definition: EmulateCPPF.h:30
EmulateCPPF::~EmulateCPPF ( )

Definition at line 53 of file EmulateCPPF.cc.

53 {}

Member Function Documentation

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

Definition at line 55 of file EmulateCPPF.cc.

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

57  {
58  if (cppfSource_ == CppfSource::File) { // Using the look up table to fill the information
59  cppf_recHit.clear();
60  for (auto &recHit_processor : recHit_processors_) {
61  recHit_processor.processLook(
63  }
64  } else if (cppfSource_ == CppfSource::EventSetup) {
65  // Clear output collections
66  // cppf_rpcDigi.clear();
67  cppf_recHit.clear();
68 
69  //Get the RPCDigis from the event
70  // Run the CPPF clusterization+coordinate conversion algo on RPCDigis and
71  // RecHits
72 
73  // For now, treat CPPF as single board
74  // In the future, may want to treat the 4 CPPF boards in each endcap as
75  // separate entities
76 
77  // for (unsigned int iBoard = 0; iBoard < rpcDigi_processors_.size();
78  // iBoard++) { rpcDigi_processors_.at(iBoard).process( iSetup, rpcDigis,
79  // cppf_rpcDigi );
80  // }
81  for (auto &recHit_processor : recHit_processors_) {
82  recHit_processor.process(iEvent, iSetup, recHitToken_, rpcDigiToken_, rpcDigiSimLinkToken_, cppf_recHit);
83  }
84  }
85 } // 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:34
std::vector< RecHitProcessor::CppfItem > CppfVec_1
Definition: EmulateCPPF.h:33
const edm::EDGetToken recHitToken_
Definition: EmulateCPPF.h:29
const edm::EDGetToken rpcDigiSimLinkToken_
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 33 of file EmulateCPPF.h.

Referenced by EmulateCPPF(), and process().

int EmulateCPPF::MaxClusterSize_
private

Definition at line 34 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 29 of file EmulateCPPF.h.

Referenced by process().

const edm::EDGetToken EmulateCPPF::rpcDigiSimLinkToken_
private

Definition at line 30 of file EmulateCPPF.h.

Referenced by process().

const edm::EDGetToken EmulateCPPF::rpcDigiToken_
private

Definition at line 28 of file EmulateCPPF.h.

Referenced by process().