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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 ( const edm::ParameterSet pset)

Constructor.

Definition at line 83 of file DTTrigProd.cc.

References my_debug, my_DTTFnum, my_lut_btic, my_lut_dump_flag, muonDTDigis_cfi::pset, and thToken_.

83  :
84  my_trig(pset, consumesCollector()),
85  phToken_{produces<L1MuDTChambPhContainer>()},
86  thToken_{produces<L1MuDTChambThContainer>()},
87  my_DTTFnum{ pset.getParameter<bool>("DTTFSectorNumbering") },
88  my_debug{ pset.getUntrackedParameter<bool>("debug") },
89  my_lut_dump_flag{ pset.getUntrackedParameter<bool>("lutDumpFlag") },
90  my_lut_btic{ static_cast<short int>(pset.getUntrackedParameter<int>("lutBtic")) }
91 {
92 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDPutTokenT< L1MuDTChambPhContainer > phToken_
Definition: DTTrigProd.cc:66
const bool my_debug
Definition: DTTrigProd.cc:76
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:79
DTTrig my_trig
Definition: DTTrigProd.cc:64
edm::EDPutTokenT< L1MuDTChambThContainer > thToken_
Definition: DTTrigProd.cc:67
const short int my_lut_btic
Definition: DTTrigProd.cc:80
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 94 of file DTTrigProd.cc.

References DTConfigManager::CCBConfigValidity(), gather_cfg::cout, DTTrig::createTUs(), DTTrig::dumpLuts(), edm::EventSetup::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().

94  {
95 
96  if(my_debug)
97  cout << "DTTrigProd::beginRun " << iRun.id().run() << endl;
98 
100  iEventSetup.get< DTConfigManagerRcd >().get( dtConfig ) ;
101 
102  my_CCBValid = dtConfig->CCBConfigValidity();
103 
104  my_trig.createTUs(iEventSetup);
105  if (my_debug)
106  cout << "[DTTrigProd] TU's Created" << endl;
107 
108  if(my_lut_dump_flag) {
109  cout << "Dumping luts...." << endl;
110  my_trig.dumpLuts(my_lut_btic, dtConfig.product());
111  }
112 
113 }
bool my_CCBValid
Definition: DTTrigProd.cc:70
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:455
const bool my_lut_dump_flag
Definition: DTTrigProd.cc:79
DTTrig my_trig
Definition: DTTrigProd.cc:64
bool CCBConfigValidity() const
flag for CCB configuration validity
const short int my_lut_btic
Definition: DTTrigProd.cc:80
T get() const
Definition: EventSetup.h:68
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:68
T const * product() const
Definition: ESHandle.h:84
void DTTrigProd::produce ( edm::Event iEvent,
const edm::EventSetup iEventSetup 
)
override

Producer: process every event and generates trigger data.

Definition at line 116 of file DTTrigProd.cc.

References gather_cfg::cout, DEFINE_FWK_MODULE, 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().

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

Member Data Documentation

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 64 of file DTTrigProd.cc.

Referenced by beginRun(), and produce().

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

Definition at line 66 of file DTTrigProd.cc.

Referenced by produce().

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

Definition at line 67 of file DTTrigProd.cc.

Referenced by DTTrigProd(), and produce().