163 char speciesName[500];
168 TTree* tree = (TTree*)
file->Get(
"species");
169 tree->SetBranchAddress(
"speciesID", &speciesID);
170 tree->SetBranchAddress(
"number", &number);
171 tree->SetBranchAddress(
"nEvent", &nEvent);
172 tree->SetBranchAddress(
"speciesName", &speciesName);
173 tree->SetBranchAddress(
"time", &time);
174 tree->SetBranchAddress(
"sumG", &sumG);
175 tree->SetBranchAddress(
"sumG2", &sumG2);
177 Long64_t
nentries = tree->GetEntries();
182 cout <<
"No entries found in the tree species contained in the file " 183 <<
file->GetPath() << endl;
191 std::map<int, std::map<double, SpeciesInfoAOS>> speciesTimeInfo;
201 infoAOS.
fG2 += sumG2;
203 infoAOS.
fName = speciesName;
208 std::map<int, SpeciesInfoSOA> speciesInfo;
210 auto it_SOA = speciesTimeInfo.begin();
211 auto end_SOA = speciesTimeInfo.end();
213 for (; it_SOA!=end_SOA ; ++it_SOA)
215 const int _speciesID = it_SOA->first;
218 auto it2 = it_SOA->second.begin();
219 auto end2 = it_SOA->second.end();
221 info.
fName = it2->second.fName;
222 const size_t size2 = it_SOA->second.size();
223 info.
fG.resize(size2);
224 info.
fGerr.resize(size2);
225 info.
fTime.resize(size2);
227 for(
int i2 = 0 ;it2!=end2;++it2, ++i2)
231 double _SumG2 = infoAOS.
fG2;
232 double _MeanG = infoAOS.
fG/infoAOS.
fNEvent;
233 double _Gerr = sqrt((_SumG2/infoAOS.
fNEvent - pow(_MeanG,2))
236 info.
fG[i2] = _MeanG;
237 info.
fGerr[i2] = _Gerr;
238 info.
fTime[i2] = it2->first;
245 #ifdef USE_CANVASINTAB 246 CanvasInTab* myFrame =
247 new CanvasInTab(gClient->GetRoot(), 500, 500);
253 for (; it !=
end; ++it)
255 speciesID = it->first;
259 if(info.
fG.empty())
continue;
261 TGraphErrors* gSpecies =
new TGraphErrors(info.
fG.size(),
267 #ifdef USE_CANVASINTAB 268 int nCanvas = myFrame->AddCanvas(info.
fName.c_str());
269 myFrame->GetCanvas(nCanvas);
270 TCanvas* cSpecies = myFrame->GetCanvas(nCanvas);
272 TCanvas* cSpecies =
new TCanvas(info.
fName.c_str(),
277 int color = (2+speciesID)%TColor::GetNumberOfColors();
278 if(color == 5 || color==10 || color==0) ++
color;
282 gSpecies->SetMarkerStyle(20+speciesID);
283 gSpecies->SetMarkerColor(color);
286 gSpecies->SetTitle((info.
fName 290 gSpecies->GetXaxis()->SetTitle(
"Time [ns]");
291 gSpecies->GetYaxis()->SetTitle(
"G [molecules/100 eV]");
292 gSpecies->Draw(
"ap");
296 #ifdef USE_CANVASINTAB 297 int nCanvas = myFrame->GetNCanvas();
298 for(
int i = 0 ; i < nCanvas ; ++i)
300 myFrame->GetCanvas(i)->Update();
std::vector< double > fTime
std::vector< double > fGerr
std::size_t color(std::string const &procname)
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)