13 #include "TClonesArray.h" 18 std::cout <<
" CocoaDaqReaderRoot opening file: " << m_inFileName << std::endl;
20 theFile =
new TFile(m_inFileName.c_str());
22 std::cerr <<
" CocoaDaqReaderRoot TTree file not found " << m_inFileName << std::endl;
31 std::cerr <<
" CocoaDaqReaderRoot TTree in file " << m_inFileName <<
" should be called 'CocoaDaq' " << std::endl;
36 nev = branch->GetEntries();
59 std::vector<OpticalAlignMeasurementInfo> measList;
66 std::cout <<
"CocoaDaqReaderRoot reading event " << nev <<
" " << nb << std::endl;
84 std::cout <<
"2D sensor " <<
ii <<
" has ID = " << pos2D->
GetID() << std::endl;
92 std::cout <<
"COPS sensor " <<
ii <<
" has ID = " << posCOPS->
GetID() << std::endl;
100 std::cout <<
"TILT sensor " <<
ii <<
" has ID = " << tilt->
GetID() << std::endl;
108 std::cout <<
"DIST sensor " <<
ii <<
" has ID = " << dist->
GetID() << std::endl;
124 meas.
type_ =
"SENSOR2D";
127 std::vector<bool> isSimu;
128 for (
size_t jj = 0;
jj < 2;
jj++) {
129 isSimu.push_back(
false);
132 std::vector<OpticalAlignParam> paramList;
134 oaParam1.
name_ =
"H:";
137 paramList.push_back(oaParam1);
140 oaParam2.
name_ =
"V:";
143 paramList.push_back(oaParam2);
157 std::vector<bool> isSimu;
158 for (
size_t jj = 0;
jj < 4;
jj++) {
159 isSimu.push_back(
false);
163 std::vector<OpticalAlignParam> paramList;
165 oaParam1.
name_ =
"U:";
168 paramList.push_back(oaParam1);
171 oaParam2.
name_ =
"U:";
174 paramList.push_back(oaParam2);
177 oaParam3.
name_ =
"U:";
180 paramList.push_back(oaParam3);
183 oaParam4.
name_ =
"U:";
186 paramList.push_back(oaParam4);
197 meas.
type_ =
"TILTMETER";
200 std::vector<bool> isSimu;
201 for (
size_t jj = 0;
jj < 2;
jj++) {
202 isSimu.push_back(
false);
205 std::vector<OpticalAlignParam> paramList;
207 oaParam.
name_ =
"T:";
210 paramList.push_back(oaParam);
221 meas.
type_ =
"DISTANCEMETER";
224 std::vector<bool> isSimu;
225 for (
size_t jj = 0;
jj < 2;
jj++) {
226 isSimu.push_back(
false);
229 std::vector<OpticalAlignParam> paramList;
231 oaParam.
name_ =
"D:";
234 paramList.push_back(oaParam);
244 std::cout <<
"@@@ CocoaDaqReaderRoot::BuildMeasurementsFromOptAlign " << std::endl;
253 ALIint nMeasRoot = measList.size();
255 std::cout <<
" Building " << nMeasRoot <<
" measurements from ROOT file " << std::endl;
259 std::vector<Measurement*>::const_iterator vmcite;
261 ALIint fcolon = (*vmcite)->name().find(
':');
263 oname = oname.substr(fcolon + 1, oname.length());
267 for (ii = 0; ii < nMeasRoot; ii++) {
269 std::cout <<
" measurement name ROOT " << measInfo.
name_ <<
" Model= " << (*vmcite)->name() <<
" short " << oname
272 if (oname == measInfo.
name_) {
275 if ((*vmcite)->type() != measInfo.
type_) {
276 std::cerr <<
"!!! Measurement from ROOT file: type in file is " << measInfo.
type_ <<
" and should be " 277 << (*vmcite)->type() << std::endl;
281 std::cout <<
" NOBJECTS IN MEAS " << (*vmcite)->OptOList().size() <<
" NMEAS " 284 std::vector<OpticalAlignParam> measValues = measInfo.
values_;
286 for (
size_t jj = 0;
jj < measValues.size();
jj++) {
287 (*vmcite)->fillData(
jj, &(measValues[
jj]));
290 std::cout <<
" NOBJECTS IN MEAS after " << (*vmcite)->OptOList().size() <<
" NMEAS " 296 if (ii == nMeasRoot) {
297 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)
bool ReadEvent(int nev) override
OpticalAlignMeasurementInfo GetMeasFromDist(AliDaqDistance *dist)
TClonesArray * GetArray_PositionCOPS() const
~CocoaDaqReaderRoot() override
Float_t GetUpError() const
TClonesArray * GetArray_Position2D() const
Float_t GetYerror() const
CocoaDaqReaderRoot(const std::string &m_inFileName)
CocoaDaqRootEvent * theEvent
Float_t GetDistanceError() const
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
void BuildMeasurementsFromOptAlign(std::vector< OpticalAlignMeasurementInfo > &measList) override
Float_t GetDownError() const
std::vector< OpticalAlignParam > values_
void DumpIt(const TString &Name)
static std::vector< Measurement * > & MeasurementList()
OpticalAlignMeasurementInfo GetMeasFromPosition2D(AliDaqPosition2D *pos2D)
std::vector< bool > isSimulatedValue_
Float_t GetRightError() const
void DumpIt(const TString &Name)
int GetNumPosCOPS() const