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)
 
static void prevalidate (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:
2011/03/28 13:47:50
Revision:
1.8
Author
C. Battilana

Main EDProducer for the DTTPG

Date:
2011/05/16 16:23:03
Revision:
1.19
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, and my_params.

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