CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTTrigProd Class Reference

#include <DTTrigProd.h>

Inheritance diagram for DTTrigProd:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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...
 
 ~DTTrigProd ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

int my_BXoffset
 
bool my_CCBValid
 
bool my_debug
 
bool my_DTTFnum
 
short int my_lut_btic
 
bool my_lut_dump_flag
 
edm::ParameterSet my_params
 
DTTrigmy_trig
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Main EDProducer for the DTTPG

Author
C. Battilana

Definition at line 27 of file DTTrigProd.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 45 of file DTTrigProd.cc.

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), my_debug, my_DTTFnum, my_lut_btic, my_lut_dump_flag, my_params, my_trig, and muonDTDigis_cfi::pset.

45  : my_trig(0) {
46 
47  produces<L1MuDTChambPhContainer>();
48  produces<L1MuDTChambThContainer>();
49 
50  my_debug = pset.getUntrackedParameter<bool>("debug");
51  my_DTTFnum = pset.getParameter<bool>("DTTFSectorNumbering");
52  my_params = pset;
53 
54  my_lut_dump_flag = pset.getUntrackedParameter<bool>("lutDumpFlag");
55  my_lut_btic = pset.getUntrackedParameter<int>("lutBtic");
56  if(!(my_trig)) my_trig = new DTTrig(my_params,consumesCollector());
57 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool my_lut_dump_flag
Definition: DTTrigProd.h:61
short int my_lut_btic
Definition: DTTrigProd.h:62
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
bool my_debug
Definition: DTTrigProd.h:58
edm::ParameterSet my_params
Definition: DTTrigProd.h:65
Definition: DTTrig.h:53
DTTrig * my_trig
Definition: DTTrigProd.h:46
bool my_DTTFnum
Definition: DTTrigProd.h:52
DTTrigProd::~DTTrigProd ( )

Destructor.

Definition at line 59 of file DTTrigProd.cc.

References my_trig.

59  {
60 
61  if (my_trig) delete my_trig;
62 
63 }
DTTrig * my_trig
Definition: DTTrigProd.h:46

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

65  {
66 
67  if(my_debug)
68  cout << "DTTrigProd::beginRun " << iRun.id().run() << endl;
69 
71  iEventSetup.get< DTConfigManagerRcd >().get( dtConfig ) ;
72 
73  my_CCBValid = dtConfig->CCBConfigValidity();
74 
75  my_trig->createTUs(iEventSetup);
76  if (my_debug)
77  cout << "[DTTrigProd] TU's Created" << endl;
78 
79  if(my_lut_dump_flag) {
80  cout << "Dumping luts...." << endl;
81  my_trig->dumpLuts(my_lut_btic, dtConfig.product());
82  }
83 
84 }
bool my_CCBValid
Definition: DTTrigProd.h:49
bool my_lut_dump_flag
Definition: DTTrigProd.h:61
short int my_lut_btic
Definition: DTTrigProd.h:62
bool my_debug
Definition: DTTrigProd.h:58
bool CCBConfigValidity() const
flag for CCB configuration validity
void dumpLuts(short int lut_btic, const DTConfigManager *conf)
Dump the LUT files.
Definition: DTTrig.cc:468
const T & get() const
Definition: EventSetup.h:55
DTTrig * my_trig
Definition: DTTrigProd.h:46
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:76
T const * product() const
Definition: ESHandle.h:86
void DTTrigProd::produce ( edm::Event iEvent,
const edm::EventSetup iEventSetup 
)
override

Producer: process every event and generates trigger data.

Definition at line 87 of file DTTrigProd.cc.

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

87  {
88 
89  vector<L1MuDTChambPhDigi> outPhi;
90  vector<L1MuDTChambThDigi> outTheta;
91 
92  // SV check if CCB configuration is valid, otherwise just produce empty collections
93  if(!my_CCBValid) {
94  if (my_debug)
95  cout << "[DTTrigProd] CCB configuration is not valid for this run, empty collection will be produced " << endl;
96  } else {
97  my_trig->triggerReco(iEvent,iEventSetup);
99 
100  if (my_debug)
101  cout << "[DTTrigProd] Trigger algorithm run for " <<iEvent.id() << endl;
102 
103  // Convert Phi Segments
104  SectCollPhiColl myPhiSegments;
105  myPhiSegments = my_trig->SCPhTrigs();
106 
107  SectCollPhiColl_iterator SCPCend = myPhiSegments.end();
108  for (SectCollPhiColl_iterator it=myPhiSegments.begin();it!=SCPCend;++it){
109  int step = (*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
110  int sc_sector = (*it).SCId().sector();
111  if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
112  outPhi.push_back(L1MuDTChambPhDigi(step,
113  (*it).ChamberId().wheel(),
114  sc_sector,
115  (*it).ChamberId().station(),
116  (*it).phi(),
117  (*it).phiB(),
118  (*it).code(),
119  !(*it).isFirst(),
120  0
121  ));
122  }
123 
124  // Convert Theta Segments
125  SectCollThetaColl myThetaSegments;
126  myThetaSegments = my_trig->SCThTrigs();
127 
128  SectCollThetaColl_iterator SCTCend = myThetaSegments.end();
129  for (SectCollThetaColl_iterator it=myThetaSegments.begin();it!=SCTCend;++it){
130  int pos[7], qual[7];
131  for (int i=0; i<7; i++){
132  pos[i] =(*it).position(i);
133  qual[i]=(*it).quality(i);
134  }
135  int step =(*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
136  int sc_sector = (*it).SCId().sector();
137  if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
138  outTheta.push_back(L1MuDTChambThDigi( step,
139  (*it).ChamberId().wheel(),
140  sc_sector,
141  (*it).ChamberId().station(),
142  pos,
143  qual
144  ));
145  }
146  }
147 
148  // Write everything into the event (CB write empty collection as default actions if emulator does not run)
149  std::unique_ptr<L1MuDTChambPhContainer> resultPhi (new L1MuDTChambPhContainer);
150  resultPhi->setContainer(outPhi);
151  iEvent.put(std::move(resultPhi));
152  std::unique_ptr<L1MuDTChambThContainer> resultTheta (new L1MuDTChambThContainer);
153  resultTheta->setContainer(outTheta);
154  iEvent.put(std::move(resultTheta));
155 
156 }
bool my_CCBValid
Definition: DTTrigProd.h:49
int getBXOffset()
Get BX Offset.
Definition: DTTrig.h:183
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
vector< DTSectCollThSegm > SectCollThetaColl
Definition: DTTrigProd.cc:42
std::vector< DTSectCollPhSegm > SCPhTrigs()
Return a copy of all the Sector Collector (Phi) triggers.
Definition: DTTrig.cc:551
SectCollThetaColl::const_iterator SectCollThetaColl_iterator
Definition: DTTrigProd.cc:43
int my_BXoffset
Definition: DTTrigProd.h:55
void triggerReco(const edm::Event &iEvent, const edm::EventSetup &iSetup)
Run the whole trigger reconstruction chain.
Definition: DTTrig.cc:150
bool my_debug
Definition: DTTrigProd.h:58
DTTrig * my_trig
Definition: DTTrigProd.h:46
SectCollPhiColl::const_iterator SectCollPhiColl_iterator
Definition: DTTrigProd.cc:41
edm::EventID id() const
Definition: EventBase.h:60
bool my_DTTFnum
Definition: DTTrigProd.h:52
step
vector< DTSectCollPhSegm > SectCollPhiColl
Definition: DTTrigProd.cc:40
def move(src, dest)
Definition: eostools.py:510
std::vector< DTSectCollThSegm > SCThTrigs()
Return a copy of all the Sector Collector (Theta) triggers.
Definition: DTTrig.cc:580

Member Data Documentation

int DTTrigProd::my_BXoffset
private

Definition at line 55 of file DTTrigProd.h.

Referenced by produce().

bool DTTrigProd::my_CCBValid
private

Definition at line 49 of file DTTrigProd.h.

Referenced by beginRun(), and produce().

bool DTTrigProd::my_debug
private

Definition at line 58 of file DTTrigProd.h.

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

bool DTTrigProd::my_DTTFnum
private

Definition at line 52 of file DTTrigProd.h.

Referenced by DTTrigProd(), and produce().

short int DTTrigProd::my_lut_btic
private

Definition at line 62 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

bool DTTrigProd::my_lut_dump_flag
private

Definition at line 61 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

edm::ParameterSet DTTrigProd::my_params
private

Definition at line 65 of file DTTrigProd.h.

Referenced by DTTrigProd().

DTTrig* DTTrigProd::my_trig
private

Definition at line 46 of file DTTrigProd.h.

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