CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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, 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"))} {}
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
const bool my_DTTFnum
Definition: DTTrigProd.cc:73

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.

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

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
bool CCBConfigValidity() const
flag for CCB configuration validity
edm::ESGetToken< DTConfigManager, DTConfigManagerRcd > dtConfigToken_
Definition: DTTrigProd.cc:67
const bool my_debug
Definition: DTTrigProd.cc:76
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:79
T const * product() const
Definition: ESHandle.h:86
DTTrig my_trig
Definition: DTTrigProd.cc:63
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
const short int my_lut_btic
Definition: DTTrigProd.cc:80
void dumpLuts(short int lut_btic, const DTConfigManager *conf) const
Dump the LUT files.
Definition: DTTrig.cc:399
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:63

◆ 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.

References gather_cfg::cout, DTTrig::getBXOffset(), mps_fire::i, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, eostools::move(), my_CCBValid, my_debug, my_DTTFnum, my_trig, phToken_, l1tGTMenu_lepSeeds_cff::qual, 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
edm::EDPutTokenT< L1MuDTChambPhContainer > phToken_
Definition: DTTrigProd.cc:65
const bool my_debug
Definition: DTTrigProd.cc:76
int getBXOffset() const
Get BX Offset.
Definition: DTTrig.h:201
vector< DTSectCollThSegm > SectCollThetaColl
Definition: DTTrigProd.cc:47
int iEvent
Definition: GenABIO.cc:224
std::vector< DTSectCollPhSegm > SCPhTrigs() const
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:466
SectCollThetaColl::const_iterator SectCollThetaColl_iterator
Definition: DTTrigProd.cc:48
DTTrig my_trig
Definition: DTTrigProd.cc:63
std::vector< DTSectCollThSegm > SCThTrigs() const
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:489
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
SectCollPhiColl::const_iterator SectCollPhiColl_iterator
Definition: DTTrigProd.cc:46
const bool my_DTTFnum
Definition: DTTrigProd.cc:73
step
Definition: StallMonitor.cc:83
vector< DTSectCollPhSegm > SectCollPhiColl
Definition: DTTrigProd.cc:45
def move(src, dest)
Definition: eostools.py:511

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