CMS 3D CMS Logo

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, DTConfigManagerRcddtConfigToken_
 
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< L1MuDTChambPhContainerphToken_
 
edm::EDPutTokenT< L1MuDTChambThContainerthToken_
 

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::DTTrigProd ( const edm::ParameterSet pset)

Constructor.

Definition at line 83 of file DTTrigProd.cc.

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"))} {}

Member Function Documentation

◆ beginRun()

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.

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 }

References DTConfigManager::CCBConfigValidity(), 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< T >::product(), and edm::RunID::run().

◆ produce()

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.

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 }

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

Member Data Documentation

◆ dtConfigToken_

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

Definition at line 67 of file DTTrigProd.cc.

Referenced by beginRun().

◆ my_CCBValid

bool DTTrigProd::my_CCBValid = false
private

Definition at line 70 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

◆ my_debug

const bool DTTrigProd::my_debug
private

Definition at line 76 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

◆ my_DTTFnum

const bool DTTrigProd::my_DTTFnum
private

Definition at line 73 of file DTTrigProd.cc.

Referenced by produce().

◆ my_lut_btic

const short int DTTrigProd::my_lut_btic
private

Definition at line 80 of file DTTrigProd.cc.

Referenced by beginRun().

◆ my_lut_dump_flag

const bool DTTrigProd::my_lut_dump_flag
private

Definition at line 79 of file DTTrigProd.cc.

Referenced by beginRun().

◆ my_trig

DTTrig DTTrigProd::my_trig
private

Definition at line 63 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

◆ phToken_

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

Definition at line 65 of file DTTrigProd.cc.

Referenced by produce().

◆ thToken_

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

Definition at line 66 of file DTTrigProd.cc.

Referenced by produce().

SectCollThetaColl
vector< DTSectCollThSegm > SectCollThetaColl
Definition: DTTrigProd.cc:47
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
DTConfigManager::CCBConfigValidity
bool CCBConfigValidity() const
flag for CCB configuration validity
Definition: DTConfigManager.h:111
mps_fire.i
i
Definition: mps_fire.py:428
DTTrig::getBXOffset
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:201
step
step
Definition: StallMonitor.cc:94
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos
Definition: PixelAliasList.h:18
SectCollPhiColl
vector< DTSectCollPhSegm > SectCollPhiColl
Definition: DTTrigProd.cc:45
DTTrigProd::my_lut_btic
const short int my_lut_btic
Definition: DTTrigProd.cc:80
DTTrig::SCPhTrigs
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:466
DTTrig::triggerReco
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:132
DTTrigProd::my_DTTFnum
const bool my_DTTFnum
Definition: DTTrigProd.cc:73
edm::ESHandle
Definition: DTSurvey.h:22
SectCollPhiColl_iterator
SectCollPhiColl::const_iterator SectCollPhiColl_iterator
Definition: DTTrigProd.cc:46
DTTrigProd::my_CCBValid
bool my_CCBValid
Definition: DTTrigProd.cc:70
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
DTTrig::SCThTrigs
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:489
DTTrigProd::dtConfigToken_
edm::ESGetToken< DTConfigManager, DTConfigManagerRcd > dtConfigToken_
Definition: DTTrigProd.cc:67
DTTrig::dumpLuts
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:399
DTTrigProd::my_debug
const bool my_debug
Definition: DTTrigProd.cc:76
eostools.move
def move(src, dest)
Definition: eostools.py:511
DTTrig::createTUs
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:63
L1MuDTChambThDigi
Definition: L1MuDTChambThDigi.h:33
DTTrigProd::phToken_
edm::EDPutTokenT< L1MuDTChambPhContainer > phToken_
Definition: DTTrigProd.cc:65
DTTrigProd::my_trig
DTTrig my_trig
Definition: DTTrigProd.cc:63
DTTrigProd::my_lut_dump_flag
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:79
SectCollThetaColl_iterator
SectCollThetaColl::const_iterator SectCollThetaColl_iterator
Definition: DTTrigProd.cc:48
DTTrigProd::thToken_
edm::EDPutTokenT< L1MuDTChambThContainer > thToken_
Definition: DTTrigProd.cc:66
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
L1MuDTChambPhDigi
Definition: L1MuDTChambPhDigi.h:31