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 Member Functions | Private Attributes
DTTFFEDReader Class Reference

#include <DTTFFEDReader.h>

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

Public Member Functions

 DTTFFEDReader (const edm::ParameterSet &pset)
 Constructor. More...
 
bool fillRawData (edm::Event &e, L1MuDTChambPhContainer::Phi_Container &phi_data, L1MuDTChambThContainer::The_Container &the_data, L1MuDTTrackContainer::TrackContainer &tra_data)
 Generate and fill FED raw data for a full event. More...
 
void produce (edm::Event &e, const edm::EventSetup &c)
 Produce digis out of raw data. More...
 
virtual ~DTTFFEDReader ()
 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 Member Functions

void analyse (edm::Event &e)
 
int bxNr (int channel)
 
void calcCRC (int myD1, int myD2, int &myC)
 
int channel (int wheel, int sector, int bx)
 
void clear ()
 
edm::InputTag getDTTFInputTag ()
 
const
L1MuDTTrackContainer::TrackContainer
k_data ()
 
void match ()
 
const
L1MuDTChambPhContainer::Phi_Container
p_data ()
 
void process (edm::Event &e)
 
int sector (int channel)
 
const
L1MuDTChambThContainer::The_Container
t_data ()
 
int wheel (int channel)
 

Private Attributes

edm::InputTag DTTFInputTag
 
L1MuDTTrackContainer::TrackContainer dtTracks
 
unsigned int efTrack [3][12][6][2]
 
unsigned int etTrack [3][12][6][2]
 
L1MuDTChambPhContainer::Phi_Container phiSegments
 
L1MuDTChambThContainer::The_Container theSegments
 
bool verbose_
 

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

L1 DT Track Finder Raw-to-Digi

J. Troconiz UAM Madrid E. Delmeire UAM Madrid

Definition at line 27 of file DTTFFEDReader.h.

Constructor & Destructor Documentation

DTTFFEDReader::DTTFFEDReader ( const edm::ParameterSet pset)

Constructor.

Definition at line 28 of file DTTFFEDReader.cc.

References edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

28  {
29 
30  produces<L1MuDTChambPhContainer>();
31  produces<L1MuDTChambThContainer>();
32  produces<L1MuDTTrackContainer>("DATA");
33 
34  DTTFInputTag = pset.getParameter<edm::InputTag>("DTTF_FED_Source");
35 
36  verbose_ = pset.getUntrackedParameter<bool>("verbose",false);
37 
38 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag DTTFInputTag
Definition: DTTFFEDReader.h:48
DTTFFEDReader::~DTTFFEDReader ( )
virtual

Destructor.

Definition at line 40 of file DTTFFEDReader.cc.

40 {}

Member Function Documentation

void DTTFFEDReader::analyse ( edm::Event e)
private

Definition at line 81 of file DTTFFEDReader.cc.

References hitfit::clear(), match(), and LaserDQM_cfg::process.

81  {
82  clear();
83  process(e);
84  match();
85  return;
86 }
void process(edm::Event &e)
int DTTFFEDReader::bxNr ( int  channel)
private

Definition at line 488 of file DTTFFEDReader.cc.

488  {
489 
490  int myChannel = channel;
491 
492  if (myChannel > 127) myChannel -= 2;
493 
494  if (myChannel < 0 || myChannel > 251 ){ return -999; }
495 
496  int myBx = 1-(myChannel%3);
497 
498  return myBx;
499 }
int channel(int wheel, int sector, int bx)
void DTTFFEDReader::calcCRC ( int  myD1,
int  myD2,
int &  myC 
)
private

Definition at line 525 of file DTTFFEDReader.cc.

References funct::C, and i.

525  {
526 
527  int myCRC[16],D[64],C[16];
528 
529  for( int i=0; i < 32; i++ ){ D[i]=(myD2>>i)&0x1; }
530  for( int i=0; i < 32; i++ ){ D[i+32]=(myD1>>i)&0x1; }
531  for( int i=0; i < 16; i++ ){ C[i]=(myC>>i)&0x1; }
532 
533  myCRC[0] = ( D[63] + D[62] + D[61] + D[60] + D[55] + D[54] +
534  D[53] + D[52] + D[51] + D[50] + D[49] + D[48] +
535  D[47] + D[46] + D[45] + D[43] + D[41] + D[40] +
536  D[39] + D[38] + D[37] + D[36] + D[35] + D[34] +
537  D[33] + D[32] + D[31] + D[30] + D[27] + D[26] +
538  D[25] + D[24] + D[23] + D[22] + D[21] + D[20] +
539  D[19] + D[18] + D[17] + D[16] + D[15] + D[13] +
540  D[12] + D[11] + D[10] + D[9] + D[8] + D[7] +
541  D[6] + D[5] + D[4] + D[3] + D[2] + D[1] +
542  D[0] + C[0] + C[1] + C[2] + C[3] + C[4] +
543  C[5] + C[6] + C[7] + C[12] + C[13] + C[14] +
544  C[15] )%2;
545 
546  myCRC[1] = ( D[63] + D[62] + D[61] + D[56] + D[55] + D[54] +
547  D[53] + D[52] + D[51] + D[50] + D[49] + D[48] +
548  D[47] + D[46] + D[44] + D[42] + D[41] + D[40] +
549  D[39] + D[38] + D[37] + D[36] + D[35] + D[34] +
550  D[33] + D[32] + D[31] + D[28] + D[27] + D[26] +
551  D[25] + D[24] + D[23] + D[22] + D[21] + D[20] +
552  D[19] + D[18] + D[17] + D[16] + D[14] + D[13] +
553  D[12] + D[11] + D[10] + D[9] + D[8] + D[7] +
554  D[6] + D[5] + D[4] + D[3] + D[2] + D[1] +
555  C[0] + C[1] + C[2] + C[3] + C[4] + C[5] +
556  C[6] + C[7] + C[8] + C[13] + C[14] + C[15] )%2;
557 
558  myCRC[2] = ( D[61] + D[60] + D[57] + D[56] + D[46] + D[42] +
559  D[31] + D[30] + D[29] + D[28] + D[16] + D[14] +
560  D[1] + D[0] + C[8] + C[9] + C[12] + C[13] )%2;
561 
562  myCRC[3] = ( D[62] + D[61] + D[58] + D[57] + D[47] + D[43] +
563  D[32] + D[31] + D[30] + D[29] + D[17] + D[15] +
564  D[2] + D[1] + C[9] + C[10] + C[13] + C[14] )%2;
565 
566  myCRC[4] = ( D[63] + D[62] + D[59] + D[58] + D[48] + D[44] +
567  D[33] + D[32] + D[31] + D[30] + D[18] + D[16] +
568  D[3] + D[2] + C[0] + C[10] + C[11] + C[14] +
569  C[15] )%2;
570 
571  myCRC[5] = ( D[63] + D[60] + D[59] + D[49] + D[45] + D[34] +
572  D[33] + D[32] + D[31] + D[19] + D[17] + D[4] +
573  D[3] + C[1] + C[11] + C[12] + C[15] )%2;
574 
575  myCRC[6] = ( D[61] + D[60] + D[50] + D[46] + D[35] + D[34] +
576  D[33] + D[32] + D[20] + D[18] + D[5] + D[4] +
577  C[2] + C[12] + C[13] )%2;
578 
579  myCRC[7] = ( D[62] + D[61] + D[51] + D[47] + D[36] + D[35] +
580  D[34] + D[33] + D[21] + D[19] + D[6] + D[5] +
581  C[3] + C[13] + C[14] )%2;
582 
583  myCRC[8] = ( D[63] + D[62] + D[52] + D[48] + D[37] + D[36] +
584  D[35] + D[34] + D[22] + D[20] + D[7] + D[6] +
585  C[0] + C[4] + C[14] + C[15] )%2;
586 
587  myCRC[9] = ( D[63] + D[53] + D[49] + D[38] + D[37] + D[36] +
588  D[35] + D[23] + D[21] + D[8] + D[7] + C[1] +
589  C[5] + C[15] )%2;
590 
591  myCRC[10] = ( D[54] + D[50] + D[39] + D[38] + D[37] + D[36] +
592  D[24] + D[22] + D[9] + D[8] + C[2] + C[6] )%2;
593 
594  myCRC[11] = ( D[55] + D[51] + D[40] + D[39] + D[38] + D[37] +
595  D[25] + D[23] + D[10] + D[9] + C[3] + C[7] )%2;
596 
597  myCRC[12] = ( D[56] + D[52] + D[41] + D[40] + D[39] + D[38] +
598  D[26] + D[24] + D[11] + D[10] + C[4] + C[8] )%2;
599 
600  myCRC[13] = ( D[57] + D[53] + D[42] + D[41] + D[40] + D[39] +
601  D[27] + D[25] + D[12] + D[11] + C[5] + C[9] )%2;
602 
603  myCRC[14] = ( D[58] + D[54] + D[43] + D[42] + D[41] + D[40] +
604  D[28] + D[26] + D[13] + D[12] + C[6] + C[10] )%2;
605 
606  myCRC[15] = ( D[63] + D[62] + D[61] + D[60] + D[59] + D[54] +
607  D[53] + D[52] + D[51] + D[50] + D[49] + D[48] +
608  D[47] + D[46] + D[45] + D[44] + D[42] + D[40] +
609  D[39] + D[38] + D[37] + D[36] + D[35] + D[34] +
610  D[33] + D[32] + D[31] + D[30] + D[29] + D[26] +
611  D[25] + D[24] + D[23] + D[22] + D[21] + D[20] +
612  D[19] + D[18] + D[17] + D[16] + D[15] + D[14] +
613  D[12] + D[11] + D[10] + D[9] + D[8] + D[7] +
614  D[6] + D[5] + D[4] + D[3] + D[2] + D[1] +
615  D[0] + C[0] + C[1] + C[2] + C[3] + C[4] +
616  C[5] + C[6] + C[11] + C[12] + C[13] + C[14] +
617  C[15] )%2;
618 
619  int tempC = 0x0;
620  for(int i=0; i<16 ; i++){ tempC = tempC + (myCRC[i]<<i); }
621  myC = tempC ;
622  return;
623 }
int i
Definition: DBlmapReader.cc:9
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
int DTTFFEDReader::channel ( int  wheel,
int  sector,
int  bx 
)
private

Definition at line 468 of file DTTFFEDReader.cc.

References funct::abs().

468  {
469 
470  // wheel : -3 -2 -1 +1 +2 +3 <=> PHTF's : N2, N1, N0, P0, P1, P2
471  // 0 <=> ETTF
472  // sector : 0 -> 11
473  // bx : -1 -> +1
474 
475  int myChannel = 255;
476 
477  if ( abs(bx) > 1) { return myChannel; }
478  if ( sector < 0 || sector > 11) { return myChannel; }
479  if ( abs(wheel) > 3) { return myChannel; }
480 
481  myChannel = sector*21 + wheel*3 - bx + 10 ;
482 
483  if (myChannel > 125) myChannel += 2;
484 
485  return myChannel;
486 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int wheel(int channel)
int sector(int channel)
void DTTFFEDReader::clear ( void  )
private

Definition at line 449 of file DTTFFEDReader.cc.

References i, j, gen::k, and ConfigFiles::l.

Referenced by Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

449  {
450  phiSegments.clear();
451  theSegments.clear();
452  dtTracks.clear();
453 
454  for(int i=0; i<3; i++){
455  for(int j=0; j<12; j++){
456  for(int k=0; k<6; k++){
457  for(int l=0; l<2; l++){
458  etTrack[i][j][k][l] = 0;
459  efTrack[i][j][k][l] = 0;
460  }
461  }
462  }
463  }
464 
465  return;
466 }
int i
Definition: DBlmapReader.cc:9
L1MuDTChambPhContainer::Phi_Container phiSegments
Definition: DTTFFEDReader.h:74
unsigned int etTrack[3][12][6][2]
Definition: DTTFFEDReader.h:80
int j
Definition: DBlmapReader.cc:9
L1MuDTChambThContainer::The_Container theSegments
Definition: DTTFFEDReader.h:76
L1MuDTTrackContainer::TrackContainer dtTracks
Definition: DTTFFEDReader.h:78
int k[5][pyjets_maxn]
unsigned int efTrack[3][12][6][2]
Definition: DTTFFEDReader.h:82
bool DTTFFEDReader::fillRawData ( edm::Event e,
L1MuDTChambPhContainer::Phi_Container phi_data,
L1MuDTChambThContainer::The_Container the_data,
L1MuDTTrackContainer::TrackContainer tra_data 
)

Generate and fill FED raw data for a full event.

Definition at line 64 of file DTTFFEDReader.cc.

67  {
68 
69  analyse(e);
70 
71  phi_data = p_data();
72  the_data = t_data();
73  tra_data = k_data();
74 
75  return true;
76 }
const L1MuDTChambThContainer::The_Container & t_data()
const L1MuDTTrackContainer::TrackContainer & k_data()
void analyse(edm::Event &e)
const L1MuDTChambPhContainer::Phi_Container & p_data()
edm::InputTag DTTFFEDReader::getDTTFInputTag ( )
inlineprivate

Definition at line 95 of file DTTFFEDReader.h.

References DTTFInputTag.

95 { return DTTFInputTag; }
edm::InputTag DTTFInputTag
Definition: DTTFFEDReader.h:48
const L1MuDTTrackContainer::TrackContainer & DTTFFEDReader::k_data ( )
private

Definition at line 445 of file DTTFFEDReader.cc.

445  {
446  return dtTracks;
447 }
L1MuDTTrackContainer::TrackContainer dtTracks
Definition: DTTFFEDReader.h:78
void DTTFFEDReader::match ( )
private

Definition at line 418 of file DTTFFEDReader.cc.

References i.

418  {
419 
421  i != dtTracks.end();
422  i++ ) {
423  int bxTh = i->bx()+1;
424  int sectorTh = i->scNum();
425  int wheelTh = i->whNum()+3;
426  if(wheelTh > 3) wheelTh-=1;
427  int muonTh = i->TrkTag();
428 
429  i->setEtaPacked(etTrack[bxTh][sectorTh][wheelTh][muonTh]);
430  i->setFineHaloPacked(efTrack[bxTh][sectorTh][wheelTh][muonTh]);
431  }
432 
433  return;
434 }
int i
Definition: DBlmapReader.cc:9
unsigned int etTrack[3][12][6][2]
Definition: DTTFFEDReader.h:80
L1MuDTTrackContainer::TrackContainer dtTracks
Definition: DTTFFEDReader.h:78
unsigned int efTrack[3][12][6][2]
Definition: DTTFFEDReader.h:82
TrackContainer::iterator TrackIterator
const L1MuDTChambPhContainer::Phi_Container & DTTFFEDReader::p_data ( )
private

Definition at line 437 of file DTTFFEDReader.cc.

437  {
438  return phiSegments;
439 }
L1MuDTChambPhContainer::Phi_Container phiSegments
Definition: DTTFFEDReader.h:74
void DTTFFEDReader::process ( edm::Event e)
private

Definition at line 89 of file DTTFFEDReader.cc.

References funct::abs(), FEDRawData::data(), data, edm::Event::getByLabel(), groupFilesInBlocks::lines, TopDecayID::muonID, phi, RecoTauCleanerPlugins::pt, and FEDRawData::size().

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::dumpPython(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::open(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::outputEventContent(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), ConfigBuilder.ConfigBuilder::scheduleSequence(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProcess(), and Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor::setProperty().

89  {
90 
91  // Container
92  vector<int> DTTFWordContainer;
93  vector<int>::iterator DTTFiterator;
94 
95  // Header constituents
96  int BOEevTy, DTTFId;
97 
98  // DTTF Payload constituents
99  int DTTFWord;
100  int DTTFChan, bitsID;
101  int addr1[2] = { 3, 3};
102  int addr2[2] = {15, 15};
103  int addr3[2] = {15, 15};
104  int addr4[2] = {15, 15};
105 
106  // Trailer constituents
107  int evtLgth , CRC;
108 
109  //--> Header
110 
112  e.getByLabel(getDTTFInputTag(),data);
113  FEDRawData dttfdata = data->FEDData(0x030C);
114  if ( dttfdata.size() == 0 ) return;
115 
116  int* dataWord1 = new int;
117  int* dataWord2 = new int;
118  unsigned char* LineFED=dttfdata.data();
119  *dataWord2=*((int*)LineFED);
120  LineFED+=4;
121  *dataWord1=*((int*)LineFED);
122  int lines = 1; // already counting header
123 
124  BOEevTy = ((*dataWord1)&0xFF000000)>>24; // positions 57 ->64
125  DTTFId = ((*dataWord2)&0x000FFF00)>>8; // positions 9 ->20
126 
127  if( (BOEevTy != 0x50) || ( DTTFId != 0x030C) ){
128  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
129  << "Not a DTTF header " << hex << *dataWord1;
130  delete dataWord1;
131  delete dataWord2;
132  return;
133  }
134 
135  int newCRC = 0xFFFF;
136  calcCRC(*dataWord1, *dataWord2, newCRC);
137 
138 
139  //--> DTTF data
140 
141  LineFED+=4;
142  *dataWord2=*((int*)LineFED);
143  LineFED+=4;
144  *dataWord1=*((int*)LineFED);
145  int chkEOE = ((*dataWord1)&0xFFF00000)>>20;
146  lines++;
147 
148  while(chkEOE != 0xA00){
149 
150  calcCRC(*dataWord1, *dataWord2, newCRC);
151 
152  DTTFWord = *dataWord1;
153  DTTFWordContainer.push_back(DTTFWord);
154  DTTFWord = *dataWord2;
155  DTTFWordContainer.push_back(DTTFWord);
156 
157  LineFED+=4;
158  *dataWord2=*((int*)LineFED);
159  LineFED+=4;
160  *dataWord1=*((int*)LineFED);
161  chkEOE = ((*dataWord1)&0xFFF00000)>>20;
162  lines++;
163 
164  if(lines > 3026){
165  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
166  << "Warning : number of DTTF lines > 3026 "; // 3026 = 1(header) + 3024(max # PHTF-ETTF 64 bits words) + 1(trailer)
167  delete dataWord1;
168  delete dataWord2;
169  return;
170  }
171 
172  } // end while-Data loop
173 
174 
175  //--> Trailer
176 
177  evtLgth = ((*dataWord1)&0x00FFFFFF); // positions 33 ->56
178  CRC = ((*dataWord2)&0xFFFF0000)>>16; // positions 17 ->32
179 
180  calcCRC(*dataWord1, (*dataWord2)&0xFFFF, newCRC);
181  if( newCRC != CRC){
182  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
183  << "Calculated CRC " << hex << newCRC << " differs from CRC in trailer " << hex << CRC;
184  delete dataWord1;
185  delete dataWord2;
186  return;
187  }
188 
189  if( lines != evtLgth){
190  if ( verbose_ ) edm::LogWarning("dttf_unpacker")
191  << "Number of words read != event length " << dec << lines << " " << evtLgth;
192  delete dataWord1;
193  delete dataWord2;
194  return;
195  }
196 
197 
198  // --> analyse event
199 
200  for( DTTFiterator = DTTFWordContainer.begin();
201  DTTFiterator != DTTFWordContainer.end();
202  DTTFiterator++ ){
203 
204  DTTFChan = ((*DTTFiterator)&0xFF000000)>>24;
205  DTTFiterator++;
206  bitsID = ((*DTTFiterator)&0xF0000000)>>28;
207 
208  int bxID = bxNr(DTTFChan);
209  if(bxID == -999) continue;
210  int wheelID = wheel(DTTFChan);
211  if(wheelID == -999) continue;
212  int sectorID = sector(DTTFChan);
213  if(sectorID == -999) continue;
214 
215  //Input
216  if(wheelID!=0 && bitsID<=0x9){
217 
218  int wheelPh = (abs(wheelID)-1)*wheelID/abs(wheelID);
219  int stationID = 0;
220  int ra = 0;
221  int ba = 0;
222  int tsqual = 0;
223  int ts2tag = 0;
224 
225  if ( ( bitsID >> 1 ) == 0 ){ stationID = 1;}
226  if ( ( bitsID >> 1 ) == 1 ){ stationID = 2;}
227  if ( ( bitsID >> 1 ) == 4 ){ stationID = 3;}
228  if ( ( bitsID >> 1 ) == 2 ){ stationID = 4;}
229 
230  if(stationID != 3){
231 
232  ts2tag = (bitsID)&0x1;
233  tsqual = (~(*DTTFiterator)&0x07)-1;
234  ba = (~(*DTTFiterator)&0x1FF8)>>3;
235  if( ba>0x1FF) ba-=0x400;
236  ra = (~(*DTTFiterator)&0x1FFE000)>>13;
237  if( ra>0x7FF) ra-=0x1000;
238  }
239  else{
240 
241  ts2tag = (bitsID)&0x1;
242  tsqual = (~(*DTTFiterator)&0x07)-1;
243  ra = (~(*DTTFiterator)&0x7FF8)>>3;
244  if( ra>0x7FF) ra-=0x1000;
245  }
246 
247  if(tsqual!=7 && wheelID!=-1){
248  phiSegments.push_back(
249  L1MuDTChambPhDigi( bxID+ts2tag, wheelPh, sectorID, stationID,
250  ra, ba, tsqual, ts2tag, 0) );
251  }
252  }
253  //Input
254 
255  //Input
256  if(wheelID==0 && bitsID<=0x4){
257 
258  int wheelTh = bitsID-2;
259 
260  int posALL, posBTI[7];
261 
262  if ( wheelTh == -2 || wheelTh == -1 ||
263  ( wheelTh == 0 && (sectorID == 0 || sectorID == 3 || sectorID == 4 || sectorID == 7 || sectorID == 8 || sectorID == 11) ) ) {
264 
265  posALL = ~(*DTTFiterator)&0x7F;
266  posBTI[0] = ~(*DTTFiterator)&0x01;
267  posBTI[1] = (~(*DTTFiterator)&0x02)>>1;
268  posBTI[2] = (~(*DTTFiterator)&0x04)>>2;
269  posBTI[3] = (~(*DTTFiterator)&0x08)>>3;
270  posBTI[4] = (~(*DTTFiterator)&0x10)>>4;
271  posBTI[5] = (~(*DTTFiterator)&0x20)>>5;
272  posBTI[6] = (~(*DTTFiterator)&0x40)>>6;
273 
274  if(posALL){
275  theSegments.push_back(
276  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 1, posBTI) );
277  }
278 
279  posALL = ~(*DTTFiterator)&0x3F80;
280  posBTI[0] = (~(*DTTFiterator)&0x0080)>>7;
281  posBTI[1] = (~(*DTTFiterator)&0x0100)>>8;
282  posBTI[2] = (~(*DTTFiterator)&0x0200)>>9;
283  posBTI[3] = (~(*DTTFiterator)&0x0400)>>10;
284  posBTI[4] = (~(*DTTFiterator)&0x0800)>>11;
285  posBTI[5] = (~(*DTTFiterator)&0x1000)>>12;
286  posBTI[6] = (~(*DTTFiterator)&0x2000)>>13;
287 
288  if(posALL){
289  theSegments.push_back(
290  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 2, posBTI) );
291  }
292 
293  posALL = ~(*DTTFiterator)&0x1FC000;
294  posBTI[0] = (~(*DTTFiterator)&0x004000)>>14;
295  posBTI[1] = (~(*DTTFiterator)&0x008000)>>15;
296  posBTI[2] = (~(*DTTFiterator)&0x010000)>>16;
297  posBTI[3] = (~(*DTTFiterator)&0x020000)>>17;
298  posBTI[4] = (~(*DTTFiterator)&0x040000)>>18;
299  posBTI[5] = (~(*DTTFiterator)&0x080000)>>19;
300  posBTI[6] = (~(*DTTFiterator)&0x100000)>>20;
301 
302  if(posALL){
303  theSegments.push_back(
304  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 3, posBTI) );
305  }
306  }
307 
308  else {
309 
310  posALL = ~(*DTTFiterator)&0x7F;
311  posBTI[6] = ~(*DTTFiterator)&0x01;
312  posBTI[5] = (~(*DTTFiterator)&0x02)>>1;
313  posBTI[4] = (~(*DTTFiterator)&0x04)>>2;
314  posBTI[3] = (~(*DTTFiterator)&0x08)>>3;
315  posBTI[2] = (~(*DTTFiterator)&0x10)>>4;
316  posBTI[1] = (~(*DTTFiterator)&0x20)>>5;
317  posBTI[0] = (~(*DTTFiterator)&0x40)>>6;
318 
319  if(posALL){
320  theSegments.push_back(
321  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 1, posBTI) );
322  }
323 
324  posALL = ~(*DTTFiterator)&0x3F80;
325  posBTI[6] = (~(*DTTFiterator)&0x0080)>>7;
326  posBTI[5] = (~(*DTTFiterator)&0x0100)>>8;
327  posBTI[4] = (~(*DTTFiterator)&0x0200)>>9;
328  posBTI[3] = (~(*DTTFiterator)&0x0400)>>10;
329  posBTI[2] = (~(*DTTFiterator)&0x0800)>>11;
330  posBTI[1] = (~(*DTTFiterator)&0x1000)>>12;
331  posBTI[0] = (~(*DTTFiterator)&0x2000)>>13;
332 
333  if(posALL){
334  theSegments.push_back(
335  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 2, posBTI) );
336  }
337 
338  posALL = ~(*DTTFiterator)&0x1FC000;
339  posBTI[6] = (~(*DTTFiterator)&0x004000)>>14;
340  posBTI[5] = (~(*DTTFiterator)&0x008000)>>15;
341  posBTI[4] = (~(*DTTFiterator)&0x010000)>>16;
342  posBTI[3] = (~(*DTTFiterator)&0x020000)>>17;
343  posBTI[2] = (~(*DTTFiterator)&0x040000)>>18;
344  posBTI[1] = (~(*DTTFiterator)&0x080000)>>19;
345  posBTI[0] = (~(*DTTFiterator)&0x100000)>>20;
346 
347  if(posALL){
348  theSegments.push_back(
349  L1MuDTChambThDigi( bxID, wheelTh, sectorID, 3, posBTI) );
350  }
351  }
352  }
353  //Input
354 
355  //Addresses
356  if(wheelID!=0 && bitsID>=0xA && bitsID<=0xB){
357 
358  int candID = bitsID - 0xA;
359 
360  addr4[candID] = ((*DTTFiterator)&0x0F);
361  addr3[candID] = ((*DTTFiterator)&0xF0)>>4;
362  addr2[candID] = ((*DTTFiterator)&0xF00)>>8;
363  addr1[candID] = ((*DTTFiterator)&0x3000)>>12;
364  }
365  //Addresses
366 
367  //Output
368  if(wheelID!=0 && bitsID>=0xC){
369 
370  int muonID = 0;
371  int pt = 0;
372  int ch = 0;
373  int phi = 0;
374  int qual = 0;
375 
376  muonID = (bitsID&0x1);
377  qual = (~(*DTTFiterator)&0x07);
378  phi = ((*DTTFiterator)&0x7F8)>>3;
379  ch = (~(*DTTFiterator)&0x800)>>11;
380  pt = (~(*DTTFiterator)&0x1F000)>>12;
381 
382  if(qual!=0){
383  dtTracks.push_back(
384  L1MuDTTrackCand( 0, phi, 0, pt, ch, 1, 0, qual, bxID, wheelID, sectorID,
385  muonID, addr1[muonID], addr2[muonID], addr3[muonID], addr4[muonID] ) );
386  }
387  }
388  //Output
389 
390  //Output
391  if(wheelID==0 && bitsID>=0x8){
392 
393  int wheelTh = bitsID&0x7;
394 
395  int etaALL;
396 
397  etaALL = ~(*DTTFiterator)&0x007F;
398  if (etaALL) {
399  etTrack[bxID+1][sectorID][wheelTh][0] = (*DTTFiterator)&0x003F;
400  efTrack[bxID+1][sectorID][wheelTh][0] = (~(*DTTFiterator)&0x0040)>>6;
401  }
402 
403  etaALL = (~(*DTTFiterator)&0x3F80)>>7;
404  if (etaALL) {
405  etTrack[bxID+1][sectorID][wheelTh][1]= ( (*DTTFiterator)&0x1F80)>>7;
406  efTrack[bxID+1][sectorID][wheelTh][1]= (~(*DTTFiterator)&0x2000)>>13;
407  }
408  }
409  //Output
410 
411  } // end for-loop container content
412 
413  delete dataWord1;
414  delete dataWord2;
415  return;
416 }
L1MuDTChambPhContainer::Phi_Container phiSegments
Definition: DTTFFEDReader.h:74
unsigned int etTrack[3][12][6][2]
Definition: DTTFFEDReader.h:80
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L1MuDTChambThContainer::The_Container theSegments
Definition: DTTFFEDReader.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
L1MuDTTrackContainer::TrackContainer dtTracks
Definition: DTTFFEDReader.h:78
unsigned int efTrack[3][12][6][2]
Definition: DTTFFEDReader.h:82
static const int muonID
Definition: TopGenEvent.h:20
void calcCRC(int myD1, int myD2, int &myC)
edm::InputTag getDTTFInputTag()
Definition: DTTFFEDReader.h:95
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
int wheel(int channel)
int bxNr(int channel)
int sector(int channel)
Definition: DDAxes.h:10
void DTTFFEDReader::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Produce digis out of raw data.

Implements edm::EDProducer.

Definition at line 42 of file DTTFFEDReader.cc.

References edm::Event::put().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

42  {
43 
44  auto_ptr<L1MuDTChambPhContainer> phi_product(new L1MuDTChambPhContainer);
45  auto_ptr<L1MuDTChambThContainer> the_product(new L1MuDTChambThContainer);
46  auto_ptr<L1MuDTTrackContainer> tra_product(new L1MuDTTrackContainer);
47 
51 
52  if (!fillRawData(e, phi_data, the_data, tra_data)) return;
53 
54  phi_product->setContainer(phi_data);
55  the_product->setContainer(the_data);
56  tra_product->setContainer(tra_data);
57 
58  e.put(phi_product);
59  e.put(the_product);
60  e.put(tra_product,"DATA");
61 
62 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
std::vector< L1MuDTTrackCand > TrackContainer
std::vector< L1MuDTChambPhDigi > Phi_Container
std::vector< L1MuDTChambThDigi > The_Container
bool fillRawData(edm::Event &e, L1MuDTChambPhContainer::Phi_Container &phi_data, L1MuDTChambThContainer::The_Container &the_data, L1MuDTTrackContainer::TrackContainer &tra_data)
Generate and fill FED raw data for a full event.
int DTTFFEDReader::sector ( int  channel)
private

Definition at line 501 of file DTTFFEDReader.cc.

Referenced by geometryXMLparser.DTAlignable::index().

501  {
502 
503  int myChannel = channel;
504 
505  if (myChannel > 127) myChannel -= 2;
506 
507  if (myChannel < 0 || myChannel > 251 ){ return -999; }
508 
509  return myChannel/21;
510 }
int channel(int wheel, int sector, int bx)
const L1MuDTChambThContainer::The_Container & DTTFFEDReader::t_data ( )
private

Definition at line 441 of file DTTFFEDReader.cc.

441  {
442  return theSegments;
443 }
L1MuDTChambThContainer::The_Container theSegments
Definition: DTTFFEDReader.h:76
int DTTFFEDReader::wheel ( int  channel)
private

Definition at line 512 of file DTTFFEDReader.cc.

Referenced by geometryXMLparser.DTAlignable::index().

512  {
513 
514  int myChannel = channel;
515 
516  if (myChannel > 127) myChannel -= 2;
517 
518  if (myChannel < 0 || myChannel > 251 ){ return -999; }
519 
520  int myWheel = ((myChannel%21)/3)-3;
521 
522  return myWheel;
523 }
int channel(int wheel, int sector, int bx)

Member Data Documentation

edm::InputTag DTTFFEDReader::DTTFInputTag
private

Definition at line 48 of file DTTFFEDReader.h.

Referenced by getDTTFInputTag().

L1MuDTTrackContainer::TrackContainer DTTFFEDReader::dtTracks
private

Definition at line 78 of file DTTFFEDReader.h.

unsigned int DTTFFEDReader::efTrack[3][12][6][2]
private

Definition at line 82 of file DTTFFEDReader.h.

unsigned int DTTFFEDReader::etTrack[3][12][6][2]
private

Definition at line 80 of file DTTFFEDReader.h.

L1MuDTChambPhContainer::Phi_Container DTTFFEDReader::phiSegments
private

Definition at line 74 of file DTTFFEDReader.h.

L1MuDTChambThContainer::The_Container DTTFFEDReader::theSegments
private

Definition at line 76 of file DTTFFEDReader.h.

bool DTTFFEDReader::verbose_
private

Definition at line 50 of file DTTFFEDReader.h.