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_
 

Detailed Description

Definition at line 10 of file EmulateCPPF.h.

Member Enumeration Documentation

◆ CppfSource

enum EmulateCPPF::CppfSource
strongprivate
Enumerator
File 
EventSetup 

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

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 }

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

◆ ~EmulateCPPF()

EmulateCPPF::~EmulateCPPF ( )

Definition at line 53 of file EmulateCPPF.cc.

53 {}

Member Function Documentation

◆ process()

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

Definition at line 55 of file EmulateCPPF.cc.

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()

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

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

Referenced by EmulateCPPF(), and process().

◆ MaxClusterSize_

int EmulateCPPF::MaxClusterSize_
private

Definition at line 34 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().

EmulateCPPF::recHit_processors_
std::array< RecHitProcessor, 1 > recHit_processors_
Definition: EmulateCPPF.h:26
edm::DetSetVector< RPCDigiSimLink >
RecHitProcessor::CppfItem::strip
int strip
Definition: RecHitProcessor.h:40
personalPlayback.fp
fp
Definition: personalPlayback.py:523
RecHitProcessor::CppfItem::lb
int lb
Definition: RecHitProcessor.h:38
EmulateCPPF::rpcDigiToken_
const edm::EDGetToken rpcDigiToken_
Definition: EmulateCPPF.h:28
RPCDigiCollection
EmulateCPPF::MaxClusterSize_
int MaxClusterSize_
Definition: EmulateCPPF.h:34
edm::FileInPath
Definition: FileInPath.h:64
File
Definition: File.h:11
RPCRecHitCollection
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EmulateCPPF::cppfSource_
enum EmulateCPPF::CppfSource cppfSource_
RecHitProcessor::CppfItem::int_phi
int int_phi
Definition: RecHitProcessor.h:43
RecHitProcessor::CppfItem::rawId
int rawId
Definition: RecHitProcessor.h:39
recoMuon::in
Definition: RecoMuonEnumerators.h:6
EmulateCPPF::CppfSource::EventSetup
iEvent
int iEvent
Definition: GenABIO.cc:224
dtResolutionTest_cfi.inputFile
inputFile
Definition: dtResolutionTest_cfi.py:14
RecHitProcessor::CppfItem
Definition: RecHitProcessor.h:37
EmulateCPPF::recHitToken_
const edm::EDGetToken recHitToken_
Definition: EmulateCPPF.h:29
EmulateCPPF::rpcDigiSimLinkToken_
const edm::EDGetToken rpcDigiSimLinkToken_
Definition: EmulateCPPF.h:30
Exception
Definition: hltDiff.cc:245
RecHitProcessor::CppfItem::int_theta
int int_theta
Definition: RecHitProcessor.h:44
RecHitProcessor::CppfItem::halfchannel
int halfchannel
Definition: RecHitProcessor.h:42
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EventSetup
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
EmulateCPPF::CppfSource::File
emulatorCppfDigis_cfi.cppfSource
cppfSource
Definition: emulatorCppfDigis_cfi.py:10
edm::InputTag
Definition: InputTag.h:15
EmulateCPPF::CppfVec_1
std::vector< RecHitProcessor::CppfItem > CppfVec_1
Definition: EmulateCPPF.h:33