ATLAS Offline Software
AFP_TDZVertex.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 {
9  m_listResults.clear();
10 
11  m_AmpThresh = 0.;
12  m_iDataType = 0;
13 
14 }
15 
17 {
18  m_listResults.clear();
19 }
20 
21 StatusCode AFP_TDZVertex::Initialize(float fAmpThresh, int iDataType)
22 {
23  m_AmpThresh = (float)fAmpThresh;
24  m_iDataType = iDataType;
25 
26  return StatusCode::SUCCESS;
27 }
28 
29 StatusCode AFP_TDZVertex::Execute(const std::list<TDHIT> &ListTDHits)
30 {
31 
32 
33  const int NST = 4;
34  const int NDET = 4;
35  const int NTRAINS = 4;
36  //const int NBARS = 32;
37 
38  std::vector<float> vecTDHit[NST][NDET][NTRAINS];
39 
40  for (int i=0; i<NST; ++i)
41  {
42  for (int j=0; j<NDET; ++j)
43  {
44  for (int k=0; k<NTRAINS; ++k)
45  {
46  vecTDHit[i][j][k].clear();
47  }
48  }
49  }
50 
51 
52  std::list<TDHIT>::const_iterator iter;
53  for (iter=ListTDHits.begin(); iter!=ListTDHits.end(); ++iter)
54  {
55  if ((*iter).fADC > m_AmpThresh)
56  {
57  //reco time + position correction + saturation
58  //cout<<"qqq "<<(*iter).nStationID<<"\t"<<(*iter).nSensitiveElementID<<"\t"<<((*iter).nDetectorID)%4<<endl;
59  if ((*iter).fADC < 100) vecTDHit[(*iter).nStationID][(*iter).nSensitiveElementID][((*iter).nDetectorID)%4].push_back( (*iter).fTDC + int(((*iter).nDetectorID)/4)*0.001 );
60  else {
61  vecTDHit[(*iter).nStationID][(*iter).nSensitiveElementID][((*iter).nDetectorID)%4].push_back(0.0);
62  }
63  }
64  }
65 
66 
67 
68  for (int i=0; i<NST; ++i)
69  {
70  for (int j=0; j<NDET; ++j)
71  {
72  for (int k=0; k<NTRAINS; ++k)
73  {
74  int TrSize = vecTDHit[i][j][k].size();
75  float TrTime = 0.;
76  int TrSat = 0;
77  if ( TrSize>0 )
78  {
79  for (int l=0; l<TrSize; ++l)
80  {
81  TrTime += (vecTDHit[i][j][k].at(l));
82  if ( vecTDHit[i][j][k].at(l)==0.0) ++TrSat;
83  }
84  // time average
85  if( TrSize!=TrSat) TrTime /= (TrSize-TrSat);
86 
88  if (1)
89  {
90  Results.nStationID = i;
91  Results.nDetectorID = j;
92  Results.nTrainID = k;
93  Results.fTrainTime = TrTime;
94  Results.nTrainSize = TrSize;
95  Results.nTrainNSat = TrSat;
96  m_listResults.push_back(Results);
97  }
98 
99  }
100  }
101  }
102  }
103 
104 
105 
106 
107  return StatusCode::SUCCESS;
108 }
109 
110 StatusCode AFP_TDZVertex::Finalize(std::list<TDRESULT>* pListResults)
111 {
112  *pListResults = m_listResults;
113 
114  return StatusCode::SUCCESS;
115 }
116 
117 
118 
120 {
121  MsgStream LogStream(Athena::getMessageSvc(), "AFP_TDZVertex::GetData()");
122  LogStream << MSG::DEBUG << "begin AFP_TDZVertex::GetData()" << endmsg;
123 
126 
127  LogStream << MSG::DEBUG << "end AFP_TDZVertex::GetData()" << endmsg;
128 }
AFP_TDZVertex::GetData
void GetData()
Definition: AFP_TDZVertex.cxx:119
AFP_TDZVertex::m_listResults
std::list< TDRESULT > m_listResults
Definition: AFP_TDZVertex.h:33
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
AFP_TDZVertex::~AFP_TDZVertex
~AFP_TDZVertex()
Definition: AFP_TDZVertex.cxx:16
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
AFP_TDZVertex::Initialize
StatusCode Initialize(float fAmpThresh, int iDataType)
Definition: AFP_TDZVertex.cxx:21
AFP_TDZVertex::m_iDataType
int m_iDataType
Definition: AFP_TDZVertex.h:30
AFP_TDZVertex::AFP_TDZVertex
AFP_TDZVertex()
Definition: AFP_TDZVertex.cxx:7
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AFP_TDZVertex::m_AmpThresh
float m_AmpThresh
Definition: AFP_TDZVertex.h:29
AFP_TDZVertex.h
AFP_TDZVertex::Finalize
StatusCode Finalize(std::list< TDRESULT > *pListResults)
Definition: AFP_TDZVertex.cxx:110
Results
std::vector< Result > Results
Definition: CscSplitClusterFitter.cxx:22
AFP_TDZVertex::Execute
StatusCode Execute(const std::list< TDHIT > &ListTDHits)
Definition: AFP_TDZVertex.cxx:29
DEBUG
#define DEBUG
Definition: page_access.h:11
_TDRESULT
Definition: AFP_UserObjects.h:24
readCCLHist.float
float
Definition: readCCLHist.py:83
fitman.k
k
Definition: fitman.py:528