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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Main EDProducer for the DTTPG

Author
C. Battilana

Definition at line 49 of file DTTrigProd.cc.

Constructor & Destructor Documentation

◆ DTTrigProd()

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

Constructor.

Definition at line 81 of file DTTrigProd.cc.

82  : my_trig(pset, consumesCollector()),
83  phToken_{produces<L1MuDTChambPhContainer>()},
84  thToken_{produces<L1MuDTChambThContainer>()},
85  my_DTTFnum{pset.getParameter<bool>("DTTFSectorNumbering")},
86  my_debug{pset.getUntrackedParameter<bool>("debug")},
87  my_lut_dump_flag{pset.getUntrackedParameter<bool>("lutDumpFlag")},
88  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 90 of file DTTrigProd.cc.

90  {
91  if (my_debug)
92  cout << "DTTrigProd::beginRun " << iRun.id().run() << endl;
93 
95  iEventSetup.get<DTConfigManagerRcd>().get(dtConfig);
96 
97  my_CCBValid = dtConfig->CCBConfigValidity();
98 
99  my_trig.createTUs(iEventSetup);
100  if (my_debug)
101  cout << "[DTTrigProd] TU's Created" << endl;
102 
103  if (my_lut_dump_flag) {
104  cout << "Dumping luts...." << endl;
105  my_trig.dumpLuts(my_lut_btic, dtConfig.product());
106  }
107 }

References DTConfigManager::CCBConfigValidity(), gather_cfg::cout, DTTrig::createTUs(), DTTrig::dumpLuts(), edm::EventSetup::get(), get, 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 109 of file DTTrigProd.cc.

109  {
110  vector<L1MuDTChambPhDigi> outPhi;
111  vector<L1MuDTChambThDigi> outTheta;
112 
113  // SV check if CCB configuration is valid, otherwise just produce empty collections
114  if (!my_CCBValid) {
115  if (my_debug)
116  cout << "[DTTrigProd] CCB configuration is not valid for this run, empty collection will be produced " << endl;
117  } else {
118  my_trig.triggerReco(iEvent, iEventSetup);
119  // BX offset used to correct DTTPG output
120  int bx_offset = my_trig.getBXOffset();
121 
122  if (my_debug)
123  cout << "[DTTrigProd] Trigger algorithm run for " << iEvent.id() << endl;
124 
125  // Convert Phi Segments
126  SectCollPhiColl myPhiSegments;
127  myPhiSegments = my_trig.SCPhTrigs();
128 
129  SectCollPhiColl_iterator SCPCend = myPhiSegments.end();
130  for (SectCollPhiColl_iterator it = myPhiSegments.begin(); it != SCPCend; ++it) {
131  int step = (*it).step() - bx_offset; // Shift correct BX to 0 (needed for DTTF data processing)
132  int sc_sector = (*it).SCId().sector();
133  if (my_DTTFnum == true)
134  sc_sector--; // Modified for DTTF numbering [0-11]
135  outPhi.push_back(L1MuDTChambPhDigi(step,
136  (*it).ChamberId().wheel(),
137  sc_sector,
138  (*it).ChamberId().station(),
139  (*it).phi(),
140  (*it).phiB(),
141  (*it).code(),
142  !(*it).isFirst(),
143  0));
144  }
145 
146  // Convert Theta Segments
147  SectCollThetaColl myThetaSegments;
148  myThetaSegments = my_trig.SCThTrigs();
149 
150  SectCollThetaColl_iterator SCTCend = myThetaSegments.end();
151  for (SectCollThetaColl_iterator it = myThetaSegments.begin(); it != SCTCend; ++it) {
152  int pos[7], qual[7];
153  for (int i = 0; i < 7; i++) {
154  pos[i] = (*it).position(i);
155  qual[i] = (*it).quality(i);
156  }
157  int step = (*it).step() - bx_offset; // Shift correct BX to 0 (needed for DTTF data processing)
158  int sc_sector = (*it).SCId().sector();
159  if (my_DTTFnum == true)
160  sc_sector--; // Modified for DTTF numbering [0-11]
161  outTheta.push_back(
162  L1MuDTChambThDigi(step, (*it).ChamberId().wheel(), sc_sector, (*it).ChamberId().station(), pos, qual));
163  }
164  }
165 
166  // Write everything into the event (CB write empty collection as default actions if emulator does not run)
167  iEvent.emplace(phToken_, std::move(outPhi));
168  iEvent.emplace(thToken_, std::move(outTheta));
169 }

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

◆ my_CCBValid

bool DTTrigProd::my_CCBValid = false
private

Definition at line 68 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

◆ my_debug

const bool DTTrigProd::my_debug
private

Definition at line 74 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

◆ my_DTTFnum

const bool DTTrigProd::my_DTTFnum
private

Definition at line 71 of file DTTrigProd.cc.

Referenced by produce().

◆ my_lut_btic

const short int DTTrigProd::my_lut_btic
private

Definition at line 78 of file DTTrigProd.cc.

Referenced by beginRun().

◆ my_lut_dump_flag

const bool DTTrigProd::my_lut_dump_flag
private

Definition at line 77 of file DTTrigProd.cc.

Referenced by beginRun().

◆ my_trig

DTTrig DTTrigProd::my_trig
private

Definition at line 62 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

◆ phToken_

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

Definition at line 64 of file DTTrigProd.cc.

Referenced by produce().

◆ thToken_

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

Definition at line 65 of file DTTrigProd.cc.

Referenced by produce().

SectCollThetaColl
vector< DTSectCollThSegm > SectCollThetaColl
Definition: DTTrigProd.cc:46
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:355
DTTrig::getBXOffset
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:196
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:44
DTTrigProd::my_lut_btic
const short int my_lut_btic
Definition: DTTrigProd.cc:78
DTTrig::SCPhTrigs
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:468
DTTrig::triggerReco
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:134
DTTrigProd::my_DTTFnum
const bool my_DTTFnum
Definition: DTTrigProd.cc:71
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle
Definition: DTSurvey.h:22
SectCollPhiColl_iterator
SectCollPhiColl::const_iterator SectCollPhiColl_iterator
Definition: DTTrigProd.cc:45
DTConfigManagerRcd
Definition: DTConfigManagerRcd.h:31
DTTrigProd::my_CCBValid
bool my_CCBValid
Definition: DTTrigProd.cc:68
iEvent
int iEvent
Definition: GenABIO.cc:224
DTTrig::SCThTrigs
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:491
get
#define get
DTTrig::dumpLuts
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:401
DTTrigProd::my_debug
const bool my_debug
Definition: DTTrigProd.cc:74
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:64
L1MuDTChambThDigi
Definition: L1MuDTChambThDigi.h:33
DTTrigProd::phToken_
edm::EDPutTokenT< L1MuDTChambPhContainer > phToken_
Definition: DTTrigProd.cc:64
DTTrigProd::my_trig
DTTrig my_trig
Definition: DTTrigProd.cc:62
DTTrigProd::my_lut_dump_flag
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:77
SectCollThetaColl_iterator
SectCollThetaColl::const_iterator SectCollThetaColl_iterator
Definition: DTTrigProd.cc:47
DTTrigProd::thToken_
edm::EDPutTokenT< L1MuDTChambThContainer > thToken_
Definition: DTTrigProd.cc:65
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
L1MuDTChambPhDigi
Definition: L1MuDTChambPhDigi.h:31