1 #include "../interface/CocoaDaqReaderRoot.h"
12 #include "TClonesArray.h"
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;
34 TBranch *branch =
theTree->GetBranch(
"Alignment_Cocoa");
36 nev = branch->GetEntries();
68 std::vector<OpticalAlignMeasurementInfo> measList;
75 if( nb == 0 )
return 0;
130 meas.
type_ =
"SENSOR2D";
133 std::vector<bool> isSimu;
134 for(
size_t jj = 0;
jj < 2;
jj++ ){
135 isSimu.push_back(
false);
138 std::vector<OpticalAlignParam> paramList;
140 oaParam1.
name_ =
"H:";
143 paramList.push_back(oaParam1);
146 oaParam2.
name_ =
"V:";
149 paramList.push_back(oaParam2);
165 std::vector<bool> isSimu;
166 for(
size_t jj = 0;
jj < 4;
jj++ ){
167 isSimu.push_back(
false);
171 std::vector<OpticalAlignParam> paramList;
173 oaParam1.
name_ =
"U:";
176 paramList.push_back(oaParam1);
179 oaParam2.
name_ =
"U:";
182 paramList.push_back(oaParam2);
185 oaParam3.
name_ =
"U:";
188 paramList.push_back(oaParam3);
191 oaParam4.
name_ =
"U:";
194 paramList.push_back(oaParam4);
207 meas.
type_ =
"TILTMETER";
210 std::vector<bool> isSimu;
211 for(
size_t jj = 0;
jj < 2;
jj++ ){
212 isSimu.push_back(
false);
215 std::vector<OpticalAlignParam> paramList;
217 oaParam.
name_ =
"T:";
220 paramList.push_back(oaParam);
234 meas.
type_ =
"DISTANCEMETER";
237 std::vector<bool> isSimu;
238 for(
size_t jj = 0;
jj < 2;
jj++ ){
239 isSimu.push_back(
false);
242 std::vector<OpticalAlignParam> paramList;
244 oaParam.
name_ =
"D:";
247 paramList.push_back(oaParam);
267 ALIint nMeasRoot = measList.size();
269 std::cout <<
" Building " << nMeasRoot <<
" measurements from ROOT file " << std::endl;
273 std::vector< Measurement* >::const_iterator vmcite;
275 ALIint fcolon = (*vmcite)->name().find(
':');
277 oname = oname.substr(fcolon+1,oname.length());
281 for(ii = 0; ii < nMeasRoot; ii++) {
283 std::cout <<
" measurement name ROOT " << measInfo.
name_ <<
" Model= " << (*vmcite)->name() <<
" short " << oname << std::endl;
285 if( oname == measInfo.
name_ ) {
288 if( (*vmcite)->type() != measInfo.
type_ ) {
289 std::cerr <<
"!!! Measurement from ROOT file: type in file is "
290 <<measInfo.
type_ <<
" and should be " << (*vmcite)->type() << std::endl;
296 std::vector<OpticalAlignParam> measValues = measInfo.
values_;
298 for(
size_t jj= 0;
jj < measValues.size();
jj++ ){
299 (*vmcite)->fillData(
jj, &(measValues[
jj]) );
308 std::cerr <<
"!!! Reading measurement from file: measurement not found! Type in list is " << oname << std::endl;
void DumpIt(TString Name)
TClonesArray * GetArray_Tilt() const
OpticalAlignMeasurementInfo GetMeasFromTilt(AliDaqTilt *tilt)
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)
virtual void BuildMeasurementsFromOptAlign(std::vector< OpticalAlignMeasurementInfo > &measList)
CocoaDaqRootEvent * theEvent
virtual bool ReadNextEvent()
Float_t GetDistanceError() const
Float_t GetTiltError() const
void DumpIt(TString Name)
void DumpIt(TString Name)
OpticalAlignMeasurementInfo GetMeasFromPositionCOPS(AliDaqPositionCOPS *posCOPS)
TClonesArray * GetArray_Dist() const
static void SetDaqReader(CocoaDaqReader *reader)
virtual bool ReadEvent(int nev)
Float_t GetXerror() const
Float_t GetLeftError() const
Float_t GetDistance() const
Float_t GetDownError() const
std::vector< OpticalAlignParam > values_
void DumpIt(TString Name)
OpticalAlignMeasurementInfo GetMeasFromPosition2D(AliDaqPosition2D *pos2D)
std::vector< bool > isSimulatedValue_
static std::vector< Measurement * > & MeasurementList()
Float_t GetRightError() const
int GetNumPosCOPS() const