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::ProductRegistryHelper

Public Member Functions

void beginRun (edm::Run &iRun, const edm::EventSetup &iEventSetup)
 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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
 
typedef WorkerT< EDProducerWorkerType
 
- 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)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Main EDProducer for the DTTPG

Date:
2009/11/02 14:18:30
Revision:
1.7
Author
C. Battilana

Main EDProducer for the DTTPG

Date:
2010/11/11 16:32:49
Revision:
1.17
Author
C. Battilana

Definition at line 29 of file DTTrigProd.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 47 of file DTTrigProd.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), my_debug, my_DTTFnum, my_lut_btic, my_lut_dump_flag, my_params, and MultipleCompare::pset.

47  : my_trig(0) {
48 
49  produces<L1MuDTChambPhContainer>();
50  produces<L1MuDTChambThContainer>();
51 
52  my_debug = pset.getUntrackedParameter<bool>("debug");
53  my_DTTFnum = pset.getParameter<bool>("DTTFSectorNumbering");
54  my_params = pset;
55 
56  my_lut_dump_flag = pset.getUntrackedParameter<bool>("lutDumpFlag");
57  my_lut_btic = pset.getUntrackedParameter<int>("lutBtic");
58 
59 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool my_lut_dump_flag
Definition: DTTrigProd.h:63
short int my_lut_btic
Definition: DTTrigProd.h:64
bool my_debug
Definition: DTTrigProd.h:60
edm::ParameterSet my_params
Definition: DTTrigProd.h:67
DTTrig * my_trig
Definition: DTTrigProd.h:48
bool my_DTTFnum
Definition: DTTrigProd.h:54
DTTrigProd::~DTTrigProd ( )

Destructor.

Definition at line 61 of file DTTrigProd.cc.

References my_trig.

61  {
62 
63  if (my_trig) delete my_trig;
64 
65 }
DTTrig * my_trig
Definition: DTTrigProd.h:48

Member Function Documentation

void DTTrigProd::beginRun ( edm::Run iRun,
const edm::EventSetup iEventSetup 
)
virtual

Create Trigger Units before starting event processing.

Reimplemented from edm::EDProducer.

Definition at line 67 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().

67  {
68 
69  if(my_debug)
70  cout << "DTTrigProd::beginRun " << iRun.id().run() << endl;
71 
73  iEventSetup.get< DTConfigManagerRcd >().get( dtConfig ) ;
74 
75  my_CCBValid = dtConfig->CCBConfigValidity();
76 
77  if (!my_trig) {
78  my_trig = new DTTrig(my_params);
79  my_trig->createTUs(iEventSetup);
80  if (my_debug)
81  cout << "[DTTrigProd] TU's Created" << endl;
82 
83  if(my_lut_dump_flag) {
84  cout << "Dumping luts...." << endl;
85  my_trig->dumpLuts(my_lut_btic, dtConfig.product());
86  }
87  }
88 
89 
90 
91 }
bool my_CCBValid
Definition: DTTrigProd.h:51
RunID const & id() const
Definition: RunBase.h:43
bool my_lut_dump_flag
Definition: DTTrigProd.h:63
RunNumber_t run() const
Definition: RunID.h:44
short int my_lut_btic
Definition: DTTrigProd.h:64
bool my_debug
Definition: DTTrigProd.h:60
edm::ParameterSet my_params
Definition: DTTrigProd.h:67
Definition: DTTrig.h:54
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:48
tuple cout
Definition: gather_cfg.py:41
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 94 of file DTTrigProd.cc.

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

94  {
95 
96  // SV check if CCB configuration is valid, otherwise just produce empty collections
97  if(!my_CCBValid) {
98  if (my_debug)
99  cout << "[DTTrigProd] CCB configuration is not valid for this run, emulator will not run ! " << endl;
100  } else {
101  my_trig->triggerReco(iEvent,iEventSetup);
103 
104  if (my_debug)
105  cout << "[DTTrigProd] Trigger algorithm run for " <<iEvent.id() << endl;
106 
107  // Convert Phi Segments
108  SectCollPhiColl myPhiSegments;
109  myPhiSegments = my_trig->SCPhTrigs();
110  vector<L1MuDTChambPhDigi> outPhi;
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  vector<L1MuDTChambThDigi> outTheta;
133 
134  SectCollThetaColl_iterator SCTCend = myThetaSegments.end();
135  for (SectCollThetaColl_iterator it=myThetaSegments.begin();it!=SCTCend;++it){
136  int pos[7], qual[7];
137  for (int i=0; i<7; i++){
138  pos[i] =(*it).position(i);
139  qual[i]=(*it).quality(i);
140  }
141  int step =(*it).step() - my_BXoffset; // Shift correct BX to 0 (needed for DTTF data processing)
142  int sc_sector = (*it).SCId().sector();
143  if (my_DTTFnum == true) sc_sector--; // Modified for DTTF numbering [0-11]
144  outTheta.push_back(L1MuDTChambThDigi( step,
145  (*it).ChamberId().wheel(),
146  sc_sector,
147  (*it).ChamberId().station(),
148  pos,
149  qual
150  ));
151  }
152 
153  // Write everything into the event
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:51
int i
Definition: DBlmapReader.cc:9
int getBXOffset()
Get BX Offset.
Definition: DTTrig.h:184
list step
Definition: launcher.py:15
vector< DTSectCollThSegm > SectCollThetaColl
Definition: DTTrigProd.cc:44
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:45
int my_BXoffset
Definition: DTTrigProd.h:57
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
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:60
DTTrig * my_trig
Definition: DTTrigProd.h:48
SectCollPhiColl::const_iterator SectCollPhiColl_iterator
Definition: DTTrigProd.cc:43
edm::EventID id() const
Definition: EventBase.h:56
bool my_DTTFnum
Definition: DTTrigProd.h:54
tuple cout
Definition: gather_cfg.py:41
vector< DTSectCollPhSegm > SectCollPhiColl
Definition: DTTrigProd.cc:42
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 57 of file DTTrigProd.h.

Referenced by produce().

bool DTTrigProd::my_CCBValid
private

Definition at line 51 of file DTTrigProd.h.

Referenced by beginRun(), and produce().

bool DTTrigProd::my_debug
private

Definition at line 60 of file DTTrigProd.h.

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

bool DTTrigProd::my_DTTFnum
private

Definition at line 54 of file DTTrigProd.h.

Referenced by DTTrigProd(), and produce().

short int DTTrigProd::my_lut_btic
private

Definition at line 64 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

bool DTTrigProd::my_lut_dump_flag
private

Definition at line 63 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

edm::ParameterSet DTTrigProd::my_params
private

Definition at line 67 of file DTTrigProd.h.

Referenced by beginRun(), and DTTrigProd().

DTTrig* DTTrigProd::my_trig
private

Definition at line 48 of file DTTrigProd.h.

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