BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofHitCount.cxx
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2//// BOOST --- BESIII Object_Oriented Simulation Tool /
3////
4////---------------------------------------------------------------------------/
5////
6////Description:
7////Author: Caogf
8////Created: Feb, 2006
9////Modified:
10////Comment:
11////
12//
13#include "Trigger/TofHitCount.h"
14
15#include "Identifier/Identifier.h"
16#include "Identifier/TofID.h"
17
18#include "RawEvent/DigiEvent.h"
19#include "RawEvent/RawDataUtil.h"
20
21#include <map>
22using namespace std;
23
24TofHitCount* TofHitCount::tof_Pointer = 0;
25
27 if ( !tof_Pointer ) tof_Pointer = new TofHitCount();
28 return tof_Pointer;
29}
30
33void TofHitCount::setTofDigi( std::vector<int>& vtofHit ) {
34 barrelHit1.clear();
35 barrelHit2.clear();
36 ecapHit.clear();
37 wcapHit.clear();
38
39 for ( std::vector<int>::iterator iter = vtofHit.begin(); iter != vtofHit.end(); iter++ )
40 {
41 int tofId = ( *iter );
42 int part, layer, im;
43 part = int( tofId / 10000. );
44 layer = int( ( tofId - part * 10000 ) / 1000. );
45 im = int( ( tofId - part * 10000 - layer * 1000 ) / 10. );
46 if ( part == 0 )
47 {
48 // east end cap: 0-47
49 if ( find( ecapHit.begin(), ecapHit.end(), im ) == ecapHit.end() )
50 { ecapHit.push_back( im ); }
51 }
52 else if ( part == 2 )
53 {
54 // west end cap: 0-47
55 if ( find( wcapHit.begin(), wcapHit.end(), im ) == wcapHit.end() )
56 { wcapHit.push_back( im ); }
57 }
58 else
59 {
60 if ( layer == 0 )
61 {
62 // the 1st layer in barrel: 0-87
63 if ( find( barrelHit1.begin(), barrelHit1.end(), im ) == barrelHit1.end() )
64 { barrelHit1.push_back( im ); }
65 }
66 if ( layer == 1 )
67 {
68 // the 2nd layer in barrel: 0-87
69 if ( find( barrelHit2.begin(), barrelHit2.end(), im ) == barrelHit2.end() )
70 { barrelHit2.push_back( im ); }
71 }
72 }
73 }
74}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
static TofHitCount * get_Tof(void)
void setTofDigi(std::vector< int > &vtofHit)