Greetings Rooter’s
I am attempting to write out an animated gif from an array of Histograms.
Problem is, the larger the histogram array the slower the production.
This might seem confusing so here is my example.
When If I were to use only the indexes
ds <1, s<1, wj <1, mom<18 (see code below) the amount of time to make this .gif is about 10 seconds
TString PID[3]={"P_","Pip_","Pim_"};
TCanvas *c1 = new TCanvas("c1","Histo",800,650);
c1->Divide(2,1);
for(int ds=0; ds<1; ds++){//9
Int_t ID = (0+ds)/3;
char giffer[50];
sprintf(giffer,"%s%s%s%s","/Volumes/Mac_Storage/YIELD/SINGLE_TRACK/YIELD_DATA/PRODUCTION/RUN_56515/FITKIN_Plots/Histogram_",PID[ID].Data(),PULL[ds].Data(),".gif+200");
for(int s=0;s<1;s++){ //6
for(int wj=0;wj<1;wj++){//15
for (int mom =0; mom <18; mom++) {//18
c1->cd(1);
TF1 *g1 = new TF1("g1","gaus",pt_lo,pt_up);
Hist_[ds][s][wj][mom]->Draw();//Fit(g1,"R,Q");
c1->cd(2);
Histcor_[ds][s][wj][mom]->Draw();//Fit(g1,"R,Q");
char axis[50];
sprintf(axis,"%s%s%s",PID[ID].Data()," ",PULL[ds].Data());
Hist_[ds][s][wj][mom]->GetXaxis()->SetTitle(axis);
Histcor_[ds][s][wj][mom]->GetXaxis()->SetTitle(axis);
c1->Print(giffer);
}//------Close Momenta
}//----------- Close Theta
}//-----------Close Sector
Now if I were to use:
ds <9, s<6, wj <15, mom<18 (same code see below) You would expect this to take approximately 2 hours.
However I ran this for 10 hours and only was able to produce an animated gif to the variables
ds =2, s=1, wj =12, mom=12
[code] TString PID[3]={“P_”,“Pip_”,“Pim_”};
TCanvas *c1 = new TCanvas(“c1”,“Histo”,800,650);
c1->Divide(2,1);
for(int ds=0; ds<9; ds++){//9
Int_t ID = (0+ds)/3;
char giffer[50];
sprintf(giffer,"%s%s%s%s","/Volumes/Mac_Storage/YIELD/SINGLE_TRACK/YIELD_DATA/PRODUCTION/RUN_56515/FITKIN_Plots/Histogram_",PID[ID].Data(),PULL[ds].Data(),".gif+200");
for(int s=0;s<6;s++){ //6
for(int wj=0;wj<15;wj++){//15
for (int mom =0; mom <18; mom++) {//18
c1->cd(1);
TF1 *g1 = new TF1("g1","gaus",pt_lo,pt_up);
Hist_[ds][s][wj][mom]->Draw();//Fit(g1,"R,Q");
c1->cd(2);
Histcor_[ds][s][wj][mom]->Draw();//Fit(g1,"R,Q");
char axis[50];
sprintf(axis,"%s%s%s",PID[ID].Data()," ",PULL[ds].Data());
Hist_[ds][s][wj][mom]->GetXaxis()->SetTitle(axis);
Histcor_[ds][s][wj][mom]->GetXaxis()->SetTitle(axis);
c1->Print(giffer);
}//------Close Momenta
}//----------- Close Theta
}//-----------Close Sector
[/code]
Why does it take mush longer, and can I do something different to shorten the time?
Thanks
Michael