CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1Analysis::L1AnalysisDTTF Class Reference

#include <L1AnalysisDTTF.h>

Public Member Functions

L1AnalysisDTTFDataFormatgetData ()
 
 L1AnalysisDTTF ()
 
void Reset ()
 
void SetDTPH (const edm::Handle< L1MuDTChambPhContainer > L1MuDTChambPhContainer, unsigned int maxDTPH)
 
void SetDTTH (const edm::Handle< L1MuDTChambThContainer > L1MuDTChambThContainer, unsigned int maxDTTH)
 
void SetDTTR (const edm::Handle< L1MuDTTrackContainer > L1MuDTTrackContainer, unsigned int maxDTTR)
 
 ~L1AnalysisDTTF ()
 

Private Attributes

L1AnalysisDTTFDataFormat dttf_
 

Detailed Description

Definition at line 22 of file L1AnalysisDTTF.h.

Constructor & Destructor Documentation

L1Analysis::L1AnalysisDTTF::L1AnalysisDTTF ( )

Definition at line 6 of file L1AnalysisDTTF.cc.

7 {
8 }
L1Analysis::L1AnalysisDTTF::~L1AnalysisDTTF ( )

Definition at line 11 of file L1AnalysisDTTF.cc.

12 {
13 
14 }

Member Function Documentation

L1AnalysisDTTFDataFormat* L1Analysis::L1AnalysisDTTF::getData ( void  )
inline

Definition at line 32 of file L1AnalysisDTTF.h.

References dttf_.

32 {return &dttf_;}
L1AnalysisDTTFDataFormat dttf_
void L1Analysis::L1AnalysisDTTF::Reset ( )
inline
void L1Analysis::L1AnalysisDTTF::SetDTPH ( const edm::Handle< L1MuDTChambPhContainer L1MuDTChambPhContainer,
unsigned int  maxDTPH 
)

Definition at line 16 of file L1AnalysisDTTF.cc.

References dttf_, L1MuDTChambPhContainer::getContainer(), L1Analysis::L1AnalysisDTTFDataFormat::phAng, L1Analysis::L1AnalysisDTTFDataFormat::phBandAng, L1Analysis::L1AnalysisDTTFDataFormat::phBx, L1Analysis::L1AnalysisDTTFDataFormat::phCode, L1Analysis::L1AnalysisDTTFDataFormat::phGlobPhi, L1Analysis::L1AnalysisDTTFDataFormat::phSe, L1Analysis::L1AnalysisDTTFDataFormat::phSize, L1Analysis::L1AnalysisDTTFDataFormat::phSt, L1Analysis::L1AnalysisDTTFDataFormat::phWh, L1Analysis::L1AnalysisDTTFDataFormat::phX, and L1Analysis::L1AnalysisDTTFDataFormat::phY.

17 {
18 
19  const L1MuDTChambPhContainer::Phi_Container *PhContainer = L1MuDTChambPhContainer->getContainer();
20 
21  dttf_.phSize = PhContainer->size();
22  int iphtr=0;
23  double pig=acos(-1);
24  for( L1MuDTChambPhContainer::Phi_Container::const_iterator
25  DTPhDigiItr = PhContainer->begin() ;
26  DTPhDigiItr != PhContainer->end() ;
27  ++DTPhDigiItr )
28  {
29  if((unsigned int) iphtr>maxDTPH-1) continue;
30  dttf_.phBx.push_back ( DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag()+1 );
31  dttf_.phWh.push_back ( DTPhDigiItr->whNum() );
32  dttf_.phSe.push_back ( DTPhDigiItr->scNum() );
33  dttf_.phSt.push_back ( DTPhDigiItr->stNum() );
34  dttf_.phAng.push_back ( DTPhDigiItr->phi() );
35  dttf_.phBandAng.push_back( DTPhDigiItr->phiB() );
36  double locphi = (((double)DTPhDigiItr->phi())/4096.0);
37  double newphi = locphi+(DTPhDigiItr->scNum()*(pig/6.));
38  if (newphi>2*pig) newphi-=2*pig;
39  if (newphi<0 ) newphi+=2*pig;
40  dttf_.phGlobPhi.push_back( newphi );
41  dttf_.phCode.push_back ( DTPhDigiItr->code() );
42  dttf_.phX.push_back ( DTPhDigiItr->scNum() );
43  dttf_.phY.push_back ( DTPhDigiItr->stNum()+4*(DTPhDigiItr->whNum()+2) );
44 
45  iphtr++;
46  }
47 
48 }
L1AnalysisDTTFDataFormat dttf_
std::vector< L1MuDTChambPhDigi > Phi_Container
Phi_Container const * getContainer() const
void L1Analysis::L1AnalysisDTTF::SetDTTH ( const edm::Handle< L1MuDTChambThContainer L1MuDTChambThContainer,
unsigned int  maxDTTH 
)

Definition at line 51 of file L1AnalysisDTTF.cc.

References dttf_, L1MuDTChambThContainer::getContainer(), L1Analysis::L1AnalysisDTTFDataFormat::thBx, L1Analysis::L1AnalysisDTTFDataFormat::thCode, L1Analysis::L1AnalysisDTTFDataFormat::thSe, L1Analysis::L1AnalysisDTTFDataFormat::thSize, L1Analysis::L1AnalysisDTTFDataFormat::thSt, L1Analysis::L1AnalysisDTTFDataFormat::thTheta, L1Analysis::L1AnalysisDTTFDataFormat::thWh, L1Analysis::L1AnalysisDTTFDataFormat::thX, and L1Analysis::L1AnalysisDTTFDataFormat::thY.

52 {
53 
54  const L1MuDTChambThContainer::The_Container* ThContainer = L1MuDTChambThContainer->getContainer();
55 
56  int ithtr=0;
57  dttf_.thSize = ThContainer->size();
58  dttf_.thTheta.ResizeTo(dttf_.thSize,7);
59  dttf_.thCode.ResizeTo(dttf_.thSize,7);
60 
61 
62  for( L1MuDTChambThContainer::The_Container::const_iterator
63  DTThDigiItr = ThContainer->begin() ;
64  DTThDigiItr != ThContainer->end() ;
65  ++DTThDigiItr )
66  {
67 
68  if((unsigned int) ithtr>maxDTTH-1) continue;
69  dttf_.thBx.push_back( DTThDigiItr->bxNum() + 1 );
70  dttf_.thWh.push_back( DTThDigiItr->whNum() );
71  dttf_.thSe.push_back( DTThDigiItr->scNum() );
72  dttf_.thSt.push_back( DTThDigiItr->stNum() );
73  dttf_.thX.push_back( DTThDigiItr->stNum()+4*(DTThDigiItr->whNum()+2) );
74 // int xpos = iwh*4+ist+1; ????
75  dttf_.thY.push_back( DTThDigiItr->scNum() );
77 
78  for (unsigned int j = 0; j < 7; j++)
79  {
80  dttf_.thTheta[ithtr][j] = DTThDigiItr->position(j);
81  dttf_.thCode[ithtr][j] = DTThDigiItr->code(j);
82  }
83 
84  ithtr++;
85 
86  }
87 }
The_Container const * getContainer() const
L1AnalysisDTTFDataFormat dttf_
std::vector< L1MuDTChambThDigi > The_Container
void L1Analysis::L1AnalysisDTTF::SetDTTR ( const edm::Handle< L1MuDTTrackContainer L1MuDTTrackContainer,
unsigned int  maxDTTR 
)

Definition at line 90 of file L1AnalysisDTTF.cc.

References dttf_, L1MuDTTrackContainer::getContainer(), mps_fire::i, createfilelist::int, L1Analysis::L1AnalysisDTTFDataFormat::trAddress, L1Analysis::L1AnalysisDTTFDataFormat::trBx, L1Analysis::L1AnalysisDTTFDataFormat::trChPck, L1Analysis::L1AnalysisDTTFDataFormat::trEtaPck, L1Analysis::L1AnalysisDTTFDataFormat::trEtaVal, L1Analysis::L1AnalysisDTTFDataFormat::trPhiGlob, L1Analysis::L1AnalysisDTTFDataFormat::trPhiPck, L1Analysis::L1AnalysisDTTFDataFormat::trPhiVal, L1Analysis::L1AnalysisDTTFDataFormat::trPtPck, L1Analysis::L1AnalysisDTTFDataFormat::trPtVal, L1Analysis::L1AnalysisDTTFDataFormat::trQual, L1Analysis::L1AnalysisDTTFDataFormat::trSc, L1Analysis::L1AnalysisDTTFDataFormat::trSize, L1Analysis::L1AnalysisDTTFDataFormat::trTag, and L1Analysis::L1AnalysisDTTFDataFormat::trWh.

91 {
92  double pig=acos(-1);
93  const L1MuDTTrackContainer::TrackContainer *tr = L1MuDTTrackContainer->getContainer();
94  int idttr = 0 ;
95  dttf_.trSize = tr->size();
96  for ( L1MuDTTrackContainer::TrackContainer::const_iterator i
97  = tr->begin(); i != tr->end(); ++i ) {
98  if((unsigned int)idttr>maxDTTR-1) continue;
99  dttf_.trBx.push_back( i->bx()+1 );
100  dttf_.trTag.push_back( i->TrkTag() );
101  dttf_.trQual.push_back( i->quality_packed() );
102  dttf_.trPtPck.push_back( i->pt_packed() );
103  dttf_.trPtVal.push_back( i->ptValue() );
104  dttf_.trPhiPck.push_back( i->phi_packed() );
105  dttf_.trPhiVal.push_back( i->phiValue() );
106  dttf_.trEtaPck.push_back( i->eta_packed() );
107  dttf_.trEtaVal.push_back( i->etaValue() );
108 
109  int phi_local = i->phi_packed();//range: 0 < phi_local < 31
110  if(phi_local > 15) phi_local -= 32; //range: -16 < phi_local < 15
111  double phi_global = (phi_local*(pig/72.))+((pig/6.)*i->scNum());// + 12*i->scNum(); //range: -16 < phi_global < 147
112  if(phi_global < 0) phi_global+=2*pig; //range: 0 < phi_global < 147
113  if(phi_global > 2*pig) phi_global-=2*pig; //range: 0 < phi_global < 143
114  dttf_.trPhiGlob.push_back( phi_global );
115  dttf_.trChPck.push_back( i->charge_packed() );
116  dttf_.trWh.push_back( i->whNum() );
117  dttf_.trSc.push_back( i->scNum() );
118  unsigned int addresses=0;
119  for (int KK = 0; KK<4; KK++){
120  addresses|=((unsigned int)(i->stNum(KK+1))<<(KK*4));
121  }
122  dttf_.trAddress.push_back(addresses);
123  idttr++;
124  }
125 
126 }
L1AnalysisDTTFDataFormat dttf_
std::vector< L1MuDTTrackCand > TrackContainer
TrackContainer const * getContainer() const

Member Data Documentation

L1AnalysisDTTFDataFormat L1Analysis::L1AnalysisDTTF::dttf_
private

Definition at line 35 of file L1AnalysisDTTF.h.

Referenced by getData(), Reset(), SetDTPH(), SetDTTH(), and SetDTTR().