1 #include "../interface/CocoaDaqReaderRoot.h" 13 #include "TClonesArray.h" 21 theFile =
new TFile(m_inFileName.c_str());
23 std::cerr <<
" CocoaDaqReaderRoot TTree file not found " << m_inFileName << std::endl;
32 std::cerr <<
" CocoaDaqReaderRoot TTree in file " << m_inFileName <<
" should be called 'CocoaDaq' " << std::endl;
37 nev = branch->GetEntries();
69 std::vector<OpticalAlignMeasurementInfo> measList;
76 if( nb == 0 )
return 0;
131 meas.
type_ =
"SENSOR2D";
134 std::vector<bool> isSimu;
135 for(
size_t jj = 0;
jj < 2;
jj++ ){
136 isSimu.push_back(
false);
139 std::vector<OpticalAlignParam> paramList;
141 oaParam1.
name_ =
"H:";
144 paramList.push_back(oaParam1);
147 oaParam2.
name_ =
"V:";
150 paramList.push_back(oaParam2);
166 std::vector<bool> isSimu;
167 for(
size_t jj = 0;
jj < 4;
jj++ ){
168 isSimu.push_back(
false);
172 std::vector<OpticalAlignParam> paramList;
174 oaParam1.
name_ =
"U:";
177 paramList.push_back(oaParam1);
180 oaParam2.
name_ =
"U:";
183 paramList.push_back(oaParam2);
186 oaParam3.
name_ =
"U:";
189 paramList.push_back(oaParam3);
192 oaParam4.
name_ =
"U:";
195 paramList.push_back(oaParam4);
208 meas.
type_ =
"TILTMETER";
211 std::vector<bool> isSimu;
212 for(
size_t jj = 0;
jj < 2;
jj++ ){
213 isSimu.push_back(
false);
216 std::vector<OpticalAlignParam> paramList;
218 oaParam.
name_ =
"T:";
221 paramList.push_back(oaParam);
235 meas.
type_ =
"DISTANCEMETER";
238 std::vector<bool> isSimu;
239 for(
size_t jj = 0;
jj < 2;
jj++ ){
240 isSimu.push_back(
false);
243 std::vector<OpticalAlignParam> paramList;
245 oaParam.
name_ =
"D:";
248 paramList.push_back(oaParam);
268 ALIint nMeasRoot = measList.size();
270 std::cout <<
" Building " << nMeasRoot <<
" measurements from ROOT file " << std::endl;
274 std::vector< Measurement* >::const_iterator vmcite;
276 ALIint fcolon = (*vmcite)->name().find(
':');
278 oname = oname.substr(fcolon+1,oname.length());
282 for(ii = 0; ii < nMeasRoot; ii++) {
284 std::cout <<
" measurement name ROOT " << measInfo.
name_ <<
" Model= " << (*vmcite)->name() <<
" short " << oname << std::endl;
286 if( oname == measInfo.
name_ ) {
289 if( (*vmcite)->type() != measInfo.
type_ ) {
290 std::cerr <<
"!!! Measurement from ROOT file: type in file is " 291 <<measInfo.
type_ <<
" and should be " << (*vmcite)->type() << std::endl;
297 std::vector<OpticalAlignParam> measValues = measInfo.
values_;
299 for(
size_t jj= 0;
jj < measValues.size();
jj++ ){
300 (*vmcite)->fillData(
jj, &(measValues[
jj]) );
309 std::cerr <<
"!!! Reading measurement from file: measurement not found! Type in list is " << oname << std::endl;
void DumpIt(const TString &Name)
TClonesArray * GetArray_Tilt() const
OpticalAlignMeasurementInfo GetMeasFromTilt(AliDaqTilt *tilt)
virtual bool ReadEvent(int nev) override
OpticalAlignMeasurementInfo GetMeasFromDist(AliDaqDistance *dist)
TClonesArray * GetArray_PositionCOPS() const
Float_t GetUpError() const
TClonesArray * GetArray_Position2D() const
Float_t GetYerror() const
CocoaDaqReaderRoot(const std::string &m_inFileName)
CocoaDaqRootEvent * theEvent
Float_t GetDistanceError() const
virtual bool ReadNextEvent() override
Float_t GetTiltError() const
void DumpIt(const TString &Name)
OpticalAlignMeasurementInfo GetMeasFromPositionCOPS(AliDaqPositionCOPS *posCOPS)
TClonesArray * GetArray_Dist() const
static void SetDaqReader(CocoaDaqReader *reader)
Float_t GetXerror() const
Float_t GetLeftError() const
Float_t GetDistance() const
virtual void BuildMeasurementsFromOptAlign(std::vector< OpticalAlignMeasurementInfo > &measList) override
Float_t GetDownError() const
std::vector< OpticalAlignParam > values_
void DumpIt(const TString &Name)
OpticalAlignMeasurementInfo GetMeasFromPosition2D(AliDaqPosition2D *pos2D)
std::vector< bool > isSimulatedValue_
static std::vector< Measurement * > & MeasurementList()
Float_t GetRightError() const
void DumpIt(const TString &Name)
int GetNumPosCOPS() const