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 Attributes
DTTrigProd Class Reference
Inheritance diagram for DTTrigProd:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (edm::Run const &iRun, const edm::EventSetup &iEventSetup) override
 Create Trigger Units before starting event processing. More...
 
 DTTrigProd (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::Event &iEvent, const edm::EventSetup &iEventSetup) override
 Producer: process every event and generates trigger data. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::ESGetToken
< DTConfigManager,
DTConfigManagerRcd
dtConfigToken_
 
bool my_CCBValid = false
 
const bool my_debug
 
const bool my_DTTFnum
 
const short int my_lut_btic
 
const bool my_lut_dump_flag
 
DTTrig my_trig
 
edm::EDPutTokenT
< L1MuDTChambPhContainer
phToken_
 
edm::EDPutTokenT
< L1MuDTChambThContainer
thToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Main EDProducer for the DTTPG

Author
C. Battilana

Definition at line 50 of file DTTrigProd.cc.

Constructor & Destructor Documentation

DTTrigProd::DTTrigProd ( const edm::ParameterSet pset)

Constructor.

Definition at line 83 of file DTTrigProd.cc.

References dtConfigToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), my_debug, my_DTTFnum, my_lut_btic, my_lut_dump_flag, and thToken_.

84  : my_trig(pset, consumesCollector()),
85  phToken_{produces<L1MuDTChambPhContainer>()},
86  thToken_{produces<L1MuDTChambThContainer>()},
87  dtConfigToken_(esConsumes<DTConfigManager, DTConfigManagerRcd, edm::Transition::BeginRun>()),
88  my_DTTFnum{pset.getParameter<bool>("DTTFSectorNumbering")},
89  my_debug{pset.getUntrackedParameter<bool>("debug")},
90  my_lut_dump_flag{pset.getUntrackedParameter<bool>("lutDumpFlag")},
91  my_lut_btic{static_cast<short int>(pset.getUntrackedParameter<int>("lutBtic"))} {}
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< DTConfigManager, DTConfigManagerRcd > dtConfigToken_
Definition: DTTrigProd.cc:67
edm::EDPutTokenT< L1MuDTChambPhContainer > phToken_
Definition: DTTrigProd.cc:65
const bool my_debug
Definition: DTTrigProd.cc:76
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:79
DTTrig my_trig
Definition: DTTrigProd.cc:63
edm::EDPutTokenT< L1MuDTChambThContainer > thToken_
Definition: DTTrigProd.cc:66
const short int my_lut_btic
Definition: DTTrigProd.cc:80
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const bool my_DTTFnum
Definition: DTTrigProd.cc:73

Member Function Documentation

void DTTrigProd::beginRun ( edm::Run const &  iRun,
const edm::EventSetup iEventSetup 
)
override

Create Trigger Units before starting event processing.

Definition at line 93 of file DTTrigProd.cc.

References gather_cfg::cout, DTTrig::createTUs(), dtConfigToken_, DTTrig::dumpLuts(), edm::EventSetup::getHandle(), edm::RunBase::id(), my_CCBValid, my_debug, my_lut_btic, my_lut_dump_flag, my_trig, edm::ESHandle< class >::product(), and edm::RunID::run().

93  {
94  if (my_debug)
95  cout << "DTTrigProd::beginRun " << iRun.id().run() << endl;
96 
97  ESHandle<DTConfigManager> dtConfig = iEventSetup.getHandle(dtConfigToken_);
98 
99  my_CCBValid = dtConfig->CCBConfigValidity();
100 
101  my_trig.createTUs(iEventSetup);
102  if (my_debug)
103  cout << "[DTTrigProd] TU's Created" << endl;
104 
105  if (my_lut_dump_flag) {
106  cout << "Dumping luts...." << endl;
107  my_trig.dumpLuts(my_lut_btic, dtConfig.product());
108  }
109 }
bool my_CCBValid
Definition: DTTrigProd.cc:70
edm::ESGetToken< DTConfigManager, DTConfigManagerRcd > dtConfigToken_
Definition: DTTrigProd.cc:67
const bool my_debug
Definition: DTTrigProd.cc:76
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:399
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:79
DTTrig my_trig
Definition: DTTrigProd.cc:63
const short int my_lut_btic
Definition: DTTrigProd.cc:80
T const * product() const
Definition: ESHandle.h:86
tuple cout
Definition: gather_cfg.py:144
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:63
void DTTrigProd::produce ( edm::Event iEvent,
const edm::EventSetup iEventSetup 
)
override

Producer: process every event and generates trigger data.

Definition at line 111 of file DTTrigProd.cc.

References gather_cfg::cout, edm::Event::emplace(), DTTrig::getBXOffset(), mps_fire::i, edm::EventBase::id(), eostools::move(), my_CCBValid, my_debug, my_DTTFnum, my_trig, phToken_, DTTrig::SCPhTrigs(), DTTrig::SCThTrigs(), thToken_, and DTTrig::triggerReco().

111  {
112  vector<L1MuDTChambPhDigi> outPhi;
113  vector<L1MuDTChambThDigi> outTheta;
114 
115  // SV check if CCB configuration is valid, otherwise just produce empty collections
116  if (!my_CCBValid) {
117  if (my_debug)
118  cout << "[DTTrigProd] CCB configuration is not valid for this run, empty collection will be produced " << endl;
119  } else {
120  my_trig.triggerReco(iEvent, iEventSetup);
121  // BX offset used to correct DTTPG output
122  int bx_offset = my_trig.getBXOffset();
123 
124  if (my_debug)
125  cout << "[DTTrigProd] Trigger algorithm run for " << iEvent.id() << endl;
126 
127  // Convert Phi Segments
128  SectCollPhiColl myPhiSegments;
129  myPhiSegments = my_trig.SCPhTrigs();
130 
131  SectCollPhiColl_iterator SCPCend = myPhiSegments.end();
132  for (SectCollPhiColl_iterator it = myPhiSegments.begin(); it != SCPCend; ++it) {
133  int step = (*it).step() - bx_offset; // Shift correct BX to 0 (needed for DTTF data processing)
134  int sc_sector = (*it).SCId().sector();
135  if (my_DTTFnum == true)
136  sc_sector--; // Modified for DTTF numbering [0-11]
137  outPhi.push_back(L1MuDTChambPhDigi(step,
138  (*it).ChamberId().wheel(),
139  sc_sector,
140  (*it).ChamberId().station(),
141  (*it).phi(),
142  (*it).phiB(),
143  (*it).code(),
144  !(*it).isFirst(),
145  0));
146  }
147 
148  // Convert Theta Segments
149  SectCollThetaColl myThetaSegments;
150  myThetaSegments = my_trig.SCThTrigs();
151 
152  SectCollThetaColl_iterator SCTCend = myThetaSegments.end();
153  for (SectCollThetaColl_iterator it = myThetaSegments.begin(); it != SCTCend; ++it) {
154  int pos[7], qual[7];
155  for (int i = 0; i < 7; i++) {
156  pos[i] = (*it).position(i);
157  qual[i] = (*it).quality(i);
158  }
159  int step = (*it).step() - bx_offset; // Shift correct BX to 0 (needed for DTTF data processing)
160  int sc_sector = (*it).SCId().sector();
161  if (my_DTTFnum == true)
162  sc_sector--; // Modified for DTTF numbering [0-11]
163  outTheta.push_back(
164  L1MuDTChambThDigi(step, (*it).ChamberId().wheel(), sc_sector, (*it).ChamberId().station(), pos, qual));
165  }
166  }
167 
168  // Write everything into the event (CB write empty collection as default actions if emulator does not run)
169  iEvent.emplace(phToken_, std::move(outPhi));
170  iEvent.emplace(thToken_, std::move(outTheta));
171 }
bool my_CCBValid
Definition: DTTrigProd.cc:70
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:201
edm::EDPutTokenT< L1MuDTChambPhContainer > phToken_
Definition: DTTrigProd.cc:65
const bool my_debug
Definition: DTTrigProd.cc:76
vector< DTSectCollThSegm > SectCollThetaColl
Definition: DTTrigProd.cc:47
SectCollThetaColl::const_iterator SectCollThetaColl_iterator
Definition: DTTrigProd.cc:48
DTTrig my_trig
Definition: DTTrigProd.cc:63
def move
Definition: eostools.py:511
edm::EDPutTokenT< L1MuDTChambThContainer > thToken_
Definition: DTTrigProd.cc:66
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:132
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:466
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:489
SectCollPhiColl::const_iterator SectCollPhiColl_iterator
Definition: DTTrigProd.cc:46
edm::EventID id() const
Definition: EventBase.h:59
const bool my_DTTFnum
Definition: DTTrigProd.cc:73
tuple cout
Definition: gather_cfg.py:144
step
Definition: StallMonitor.cc:94
vector< DTSectCollPhSegm > SectCollPhiColl
Definition: DTTrigProd.cc:45

Member Data Documentation

edm::ESGetToken<DTConfigManager, DTConfigManagerRcd> DTTrigProd::dtConfigToken_
private

Definition at line 67 of file DTTrigProd.cc.

Referenced by beginRun(), and DTTrigProd().

bool DTTrigProd::my_CCBValid = false
private

Definition at line 70 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

const bool DTTrigProd::my_debug
private

Definition at line 76 of file DTTrigProd.cc.

Referenced by beginRun(), DTTrigProd(), and produce().

const bool DTTrigProd::my_DTTFnum
private

Definition at line 73 of file DTTrigProd.cc.

Referenced by DTTrigProd(), and produce().

const short int DTTrigProd::my_lut_btic
private

Definition at line 80 of file DTTrigProd.cc.

Referenced by beginRun(), and DTTrigProd().

const bool DTTrigProd::my_lut_dump_flag
private

Definition at line 79 of file DTTrigProd.cc.

Referenced by beginRun(), and DTTrigProd().

DTTrig DTTrigProd::my_trig
private

Definition at line 63 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

edm::EDPutTokenT<L1MuDTChambPhContainer> DTTrigProd::phToken_
private

Definition at line 65 of file DTTrigProd.cc.

Referenced by produce().

edm::EDPutTokenT<L1MuDTChambThContainer> DTTrigProd::thToken_
private

Definition at line 66 of file DTTrigProd.cc.

Referenced by DTTrigProd(), and produce().