Create the transient representation of an object, given an opaque address. This and the following update method comprise the core functionality of calibration converters. Convenience routine used by most CAL calibration types, which have a <dimension> element describing how the remainder of the Data is laid out. Read from TDS; store information internally in protected members. Given a pointer to a TDS object which can be cast to "our" type, fill in corresponding information in the corresponding root class
44 {
45
46 MsgStream log(
msgSvc(),
"RootTofSimDataCnv" );
47 log << MSG::DEBUG << "SetProperty" << endmsg;
48
49
51 if ( !sc ) { log << MSG::ERROR << "unable to open files" << endmsg; }
52
53 CalibData::BTofSimBase bTof;
54 CalibData::ETofSimBase eTof;
55 CalibData::TofSimConstBase tofbase;
56 std::vector<CalibData::BTofSimBase> tmpbTof;
57 std::vector<CalibData::ETofSimBase> tmpeTof;
58 std::vector<CalibData::TofSimConstBase> tofbaseCol;
59
60 int cnt;
61
62 double AttenLength;
63 double Gain;
64 double Ratio;
65 double NoiseSmear;
66 TTree* btoftree = (TTree*)
m_inFile->Get(
"BTofSim" );
67 btoftree->SetBranchAddress( "AttenLength", &AttenLength );
68 btoftree->SetBranchAddress( "Gain", &Gain );
69 btoftree->SetBranchAddress( "Ratio", &Ratio );
70 int entries = btoftree->GetEntries();
71 for ( cnt = 0; cnt < entries; cnt++ )
72 {
73 btoftree->GetEntry( cnt );
77 tmpbTof.push_back( bTof );
78 }
79
80 TTree* etoftree = (TTree*)
m_inFile->Get(
"ETofSim" );
81 etoftree->SetBranchAddress( "Gain", &Gain );
82 etoftree->SetBranchAddress( "AttenLength", &AttenLength );
83 etoftree->SetBranchAddress( "NoiseSmear", &NoiseSmear );
84 entries = etoftree->GetEntries();
85 for ( cnt = 0; cnt < entries; cnt++ )
86 {
87 etoftree->GetEntry( cnt );
91 tmpeTof.push_back( eTof );
92 }
93
94
95 double BarConstant, BarPMTGain, BarHighThres, BarLowThres, EndConstant, EndPMTGain,
96 EndHighThres, EndLowThres, EndNoiseSwitch;
97 TTree* btofcommontree = (TTree*)
m_inFile->Get(
"SimConstants" );
98 btofcommontree->SetBranchAddress( "BarConstant", &BarConstant );
99 btofcommontree->SetBranchAddress( "BarPMTGain", &BarPMTGain );
100 btofcommontree->SetBranchAddress( "BarHighThres", &BarHighThres );
101 btofcommontree->SetBranchAddress( "BarLowThres", &BarLowThres );
102 btofcommontree->SetBranchAddress( "EndConstant", &EndConstant );
103 btofcommontree->SetBranchAddress( "EndPMTGain", &EndPMTGain );
104 btofcommontree->SetBranchAddress( "EndHighThres", &EndHighThres );
105 btofcommontree->SetBranchAddress( "EndLowThres", &EndLowThres );
106 btofcommontree->SetBranchAddress( "EndNoiseSwitch", &EndNoiseSwitch );
107 entries = btofcommontree->GetEntries();
108 for ( cnt = 0; cnt < entries; cnt++ )
109 {
110 btofcommontree->GetEntry( cnt );
120 tofbaseCol.push_back( tofbase );
121 }
122
123 CalibData::TofSimData* tmpObject =
124 new CalibData::TofSimData( &tofbaseCol, &tmpbTof, &tmpeTof );
125
126 refpObject = tmpObject;
127
128 return StatusCode::SUCCESS;
129}
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)
StatusCode openRead(const std::string &fname)