35 {
36
37 MsgStream log(
msgSvc(),
"TreeTofSimDataCnv" );
38 log << MSG::DEBUG << "SetProperty" << endmsg;
39
40 TreeAddress* add = dynamic_cast<TreeAddress*>( addr );
41
42 DatabaseRecord* records = add->
pp();
43
44 TBufferFile* buf1 = new TBufferFile( TBuffer::kRead );
45 TBufferFile* buf2 = new TBufferFile( TBuffer::kRead );
46 TBufferFile* buf3 = new TBufferFile( TBuffer::kRead );
47
48 buf1->SetBuffer( ( *records )["BTofSim"], 512000, kFALSE );
49 buf2->SetBuffer( ( *records )["ETofSim"], 512000, kFALSE );
50 buf3->SetBuffer( ( *records )["SimConstants"], 512000, kFALSE );
51
52 std::cout << " SftVer is " << ( *records )["SftVer"];
53 std::cout << " CalVerSft is " << ( *records )["TofSimParVer"];
54 std::cout << " File name is " << ( *records )["FileName"] << std::endl;
55
56 TTree* btoftree = new TTree();
57 TTree* etoftree = new TTree();
58 TTree* btofcommontree = new TTree();
59 btoftree->Streamer( *buf1 );
60 etoftree->Streamer( *buf2 );
61 btofcommontree->Streamer( *buf3 );
62
63 CalibData::BTofSimBase bTof;
64 CalibData::ETofSimBase eTof;
65 CalibData::TofSimConstBase tofbase;
66 std::vector<CalibData::BTofSimBase> tmpbTof;
67 std::vector<CalibData::ETofSimBase> tmpeTof;
68 std::vector<CalibData::TofSimConstBase> tofbaseCol;
69
70 int cnt;
71
72 double AttenLength;
73 double Gain;
74 double Ratio;
75 double NoiseSmear;
76 btoftree->SetBranchAddress( "AttenLength", &AttenLength );
77 btoftree->SetBranchAddress( "Gain", &Gain );
78 btoftree->SetBranchAddress( "Ratio", &Ratio );
79 int entries = btoftree->GetEntries();
80 for ( cnt = 0; cnt < entries; cnt++ )
81 {
82 btoftree->GetEntry( cnt );
86 tmpbTof.push_back( bTof );
87 }
88
89 etoftree->SetBranchAddress( "Gain", &Gain );
90 etoftree->SetBranchAddress( "AttenLength", &AttenLength );
91 etoftree->SetBranchAddress( "NoiseSmear", &NoiseSmear );
92 entries = etoftree->GetEntries();
93 for ( cnt = 0; cnt < entries; cnt++ )
94 {
95 etoftree->GetEntry( cnt );
99 tmpeTof.push_back( eTof );
100 }
101
102 double BarConstant, BarPMTGain, BarHighThres, BarLowThres, EndConstant, EndPMTGain,
103 EndHighThres, EndLowThres, EndNoiseSwitch;
104 btofcommontree->SetBranchAddress( "BarConstant", &BarConstant );
105 btofcommontree->SetBranchAddress( "BarPMTGain", &BarPMTGain );
106 btofcommontree->SetBranchAddress( "BarHighThres", &BarHighThres );
107 btofcommontree->SetBranchAddress( "BarLowThres", &BarLowThres );
108 btofcommontree->SetBranchAddress( "EndConstant", &EndConstant );
109 btofcommontree->SetBranchAddress( "EndPMTGain", &EndPMTGain );
110 btofcommontree->SetBranchAddress( "EndHighThres", &EndHighThres );
111 btofcommontree->SetBranchAddress( "EndLowThres", &EndLowThres );
112 btofcommontree->SetBranchAddress( "EndNoiseSwitch", &EndNoiseSwitch );
113 entries = btofcommontree->GetEntries();
114 for ( cnt = 0; cnt < entries; cnt++ )
115 {
116 btofcommontree->GetEntry( cnt );
126 tofbaseCol.push_back( tofbase );
127 }
128
129 CalibData::TofSimData* tmpObject =
130 new CalibData::TofSimData( &tofbaseCol, &tmpbTof, &tmpeTof );
131 refpObject = tmpObject;
132 delete btoftree;
133 delete etoftree;
134 delete btofcommontree;
135
136 return StatusCode::SUCCESS;
137}
void setRatio(double ratio)
void setGain(double gain)
void setAttenLength(double length)
void setGain(double gain)
void setAttenLength(double length)
void setNoiseSmear(double noisesmear)
void setBarConstant(const double bc)
void setBarHighThres(const double bhth)
void setEndNoiseSwitch(const double eswitch)
void setEndHighThres(const double ehth)
void setEndConstant(const double ec)
void setBarPMTGain(const double bg)
void setEndPMTGain(const double eg)
void setEndLowThres(const double elth)
void setBarLowThres(const double blth)
virtual DatabaseRecord * pp()