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;
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(
':');
267 for (
ii = 0;
ii < nMeasRoot;
ii++) {
269 std::cout <<
" measurement name ROOT " << measInfo.
name_ <<
" Model= " << (*vmcite)->name() <<
" short " <<
oname 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)
Float_t GetDistance() const
Float_t GetTiltError() const
Float_t GetXerror() const
Float_t GetYerror() const
OpticalAlignMeasurementInfo GetMeasFromTilt(AliDaqTilt *tilt)
Float_t GetDownError() const
Float_t GetUpError() const
Float_t GetLeftError() const
bool ReadEvent(int nev) override
OpticalAlignMeasurementInfo GetMeasFromDist(AliDaqDistance *dist)
TClonesArray * GetArray_Position2D() const
~CocoaDaqReaderRoot() override
TClonesArray * GetArray_Tilt() const
Float_t GetDistanceError() const
CocoaDaqReaderRoot(const std::string &m_inFileName)
TClonesArray * GetArray_Dist() const
CocoaDaqRootEvent * theEvent
bool ReadNextEvent() override
void DumpIt(const TString &Name)
OpticalAlignMeasurementInfo GetMeasFromPositionCOPS(AliDaqPositionCOPS *posCOPS)
Float_t GetRightError() const
static void SetDaqReader(CocoaDaqReader *reader)
TClonesArray * GetArray_PositionCOPS() const
void BuildMeasurementsFromOptAlign(std::vector< OpticalAlignMeasurementInfo > &measList) override
std::vector< OpticalAlignParam > values_
void DumpIt(const TString &Name)
static std::vector< Measurement * > & MeasurementList()
OpticalAlignMeasurementInfo GetMeasFromPosition2D(AliDaqPosition2D *pos2D)
std::vector< bool > isSimulatedValue_
int GetNumPosCOPS() const
void DumpIt(const TString &Name)