CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 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
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), my_debug, my_DTTFnum, my_lut_btic, my_lut_dump_flag, and my_params.

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 
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
bool my_debug
Definition: DTTrigProd.h:58
edm::ParameterSet my_params
Definition: DTTrigProd.h:65
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 
)
overridevirtual

Create Trigger Units before starting event processing.

Reimplemented from edm::EDProducer.

Definition at line 65 of file DTTrigProd.cc.

References 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_params, my_trig, edm::ESHandle< class >::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  if (!my_trig) {
76  my_trig = new DTTrig(my_params);
77  my_trig->createTUs(iEventSetup);
78  if (my_debug)
79  cout << "[DTTrigProd] TU's Created" << endl;
80 
81  if(my_lut_dump_flag) {
82  cout << "Dumping luts...." << endl;
83  my_trig->dumpLuts(my_lut_btic, dtConfig.product());
84  }
85  }
86 
87 
88 
89 }
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
edm::ParameterSet my_params
Definition: DTTrigProd.h:65
Definition: DTTrig.h:52
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
T const * product() const
Definition: ESHandle.h:62
DTTrig * my_trig
Definition: DTTrigProd.h:46
tuple cout
Definition: gather_cfg.py:121
void createTUs(const edm::EventSetup &iSetup)
Create the trigger units and store them in the cache.
Definition: DTTrig.cc:76
void DTTrigProd::produce ( edm::Event iEvent,
const edm::EventSetup iEventSetup 
)
virtual

Producer: process every event and generates trigger data.

Implements edm::EDProducer.

Definition at line 92 of file DTTrigProd.cc.

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

92  {
93 
94  vector<L1MuDTChambPhDigi> outPhi;
95  vector<L1MuDTChambThDigi> outTheta;
96 
97  // SV check if CCB configuration is valid, otherwise just produce empty collections
98  if(!my_CCBValid) {
99  if (my_debug)
100  cout << "[DTTrigProd] CCB configuration is not valid for this run, empty collection will be produced " << endl;
101  } else {
102  my_trig->triggerReco(iEvent,iEventSetup);
104 
105  if (my_debug)
106  cout << "[DTTrigProd] Trigger algorithm run for " <<iEvent.id() << endl;
107 
108  // Convert Phi Segments
109  SectCollPhiColl myPhiSegments;
110  myPhiSegments = my_trig->SCPhTrigs();
111 
112  SectCollPhiColl_iterator SCPCend = myPhiSegments.end();
113  for (SectCollPhiColl_iterator it=myPhiSegments.begin();it!=SCPCend;++it){
114  int step = (*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
115  int sc_sector = (*it).SCId().sector();
116  if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
117  outPhi.push_back(L1MuDTChambPhDigi(step,
118  (*it).ChamberId().wheel(),
119  sc_sector,
120  (*it).ChamberId().station(),
121  (*it).phi(),
122  (*it).phiB(),
123  (*it).code(),
124  !(*it).isFirst(),
125  0
126  ));
127  }
128 
129  // Convert Theta Segments
130  SectCollThetaColl myThetaSegments;
131  myThetaSegments = my_trig->SCThTrigs();
132 
133  SectCollThetaColl_iterator SCTCend = myThetaSegments.end();
134  for (SectCollThetaColl_iterator it=myThetaSegments.begin();it!=SCTCend;++it){
135  int pos[7], qual[7];
136  for (int i=0; i<7; i++){
137  pos[i] =(*it).position(i);
138  qual[i]=(*it).quality(i);
139  }
140  int step =(*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
141  int sc_sector = (*it).SCId().sector();
142  if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
143  outTheta.push_back(L1MuDTChambThDigi( step,
144  (*it).ChamberId().wheel(),
145  sc_sector,
146  (*it).ChamberId().station(),
147  pos,
148  qual
149  ));
150  }
151  }
152 
153  // Write everything into the event (CB write empty collection as default actions if emulator does not run)
154  std::auto_ptr<L1MuDTChambPhContainer> resultPhi (new L1MuDTChambPhContainer);
155  resultPhi->setContainer(outPhi);
156  iEvent.put(resultPhi);
157  std::auto_ptr<L1MuDTChambThContainer> resultTheta (new L1MuDTChambThContainer);
158  resultTheta->setContainer(outTheta);
159  iEvent.put(resultTheta);
160 
161 }
bool my_CCBValid
Definition: DTTrigProd.h:49
int i
Definition: DBlmapReader.cc:9
int getBXOffset()
Get BX Offset.
Definition: DTTrig.h:182
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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
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:56
bool my_DTTFnum
Definition: DTTrigProd.h:52
tuple cout
Definition: gather_cfg.py:121
vector< DTSectCollPhSegm > SectCollPhiColl
Definition: DTTrigProd.cc:40
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 beginRun(), and DTTrigProd().

DTTrig* DTTrigProd::my_trig
private

Definition at line 46 of file DTTrigProd.h.

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