24 #include "TSeqCollection.h"
25 #include "TGeoManager.h"
30 #include "TProofOutputFile.h"
52 fIsInitialized(kFALSE),
60 fInFileIsOpen(kFALSE),
68 fProofAnalysis(kFALSE),
69 fRunOnProofWorker(kFALSE),
71 fProofParName(
"$VMCWORKDIR/gconfig/libFairRoot.par"),
73 fProofOutputStatus(
"copy"),
74 fFinishProcessingLMDFile(kFALSE)
86 fIsInitialized(kFALSE),
95 fInFileIsOpen(kFALSE),
103 fProofAnalysis(kFALSE),
104 fRunOnProofWorker(kFALSE),
105 fProofServerName(proofName),
106 fProofParName(
"$VMCWORKDIR/gconfig/libFairRoot.par"),
107 fOutputDirectory(
""),
108 fProofOutputStatus(
"copy"),
109 fFinishProcessingLMDFile(kFALSE)
111 TString anaType = type;
118 if ( anaType.Contains(
"proof") ) {
122 cout <<
"+++++++ T P R O O F +++++++++++++++++++++++++++++++++" << endl;
123 cout <<
"creating TProof* proof = TProof::Open(\"" <<
fProofServerName.Data()
125 TProof::AddEnvVar(
"LOCALDATASERVER",
"file://");
128 cout <<
"+++++++ C R E A T E D +++++++++++++++++++++++++++++++" << endl;
158 TFile* CurrentFile=gFile;
205 while ((key = (TKey*)next())) {
206 if (strcmp(key->GetClassName(),
"TGeoManager") != 0) {
209 gGeoManager = (TGeoManager*)key->ReadObj();
232 TFile* currentfile= gFile;
234 TSeqCollection* fileList=gROOT->GetListOfFiles();
235 for (Int_t
k=0;
k<fileList->GetEntries();
k++) {
236 nextfile=(TFile*)fileList->At(
k);
238 nextfile->Get(
"FAIRGeom");
257 while ((key = (TKey*)next())) {
258 if (strcmp(key->GetClassName(),
"TGeoManager") != 0) {
261 gGeoManager = (TGeoManager*)key->ReadObj();
275 gROOT->GetListOfBrowsables()->Add(
fTask);
316 if (gGeoManager==0) {
348 if (gGeoManager==0) {
353 if (gGeoManager==0) {
382 if (fieldfact && !
fField) {
395 TTree* outTree =
new TTree(
"cbmsim",
"/cbmout", 99);
432 if (gGeoManager==0) {
450 if ( Ev_end > MaxAllowed ) {
456 if (Ev_end > MaxAllowed) {
461 for (
int i=Ev_start; i< Ev_end; i++) {
465 fTask->ExecuteTask(
"");
513 if (Ev_end > fileEnd) {
514 cout <<
"-------------------Warning---------------------------" << endl;
515 cout <<
" -W FairRunAna : File has less events than requested!!" << endl;
516 cout <<
" File contains : " << fileEnd <<
" Events" << endl;
517 cout <<
" Requested number of events = " << Ev_end <<
" Events"<< endl;
518 cout <<
" The number of events is set to " << fileEnd <<
" Events"<< endl;
519 cout <<
"-----------------------------------------------------" << endl;
528 for (
int i=Ev_start; i< Ev_end; i++) {
549 fTask->ExecuteTask(
"");
576 fTask->ExecuteTask(
"");
609 fTask->ExecuteTask(
"");
637 fTask->ExecuteTask(
"");
648 Int_t globalEvent = 0;
650 bool firstRun =
true;
653 if (globalEvent < fRootManager->GetInTree()->GetEntriesFast()) {
656 fTask->ExecuteTask(
"");
674 if(NStart==0 && NStop==0) {
679 for (UInt_t i=NStart; i< NStop; i++) {
685 fTask->ExecuteTask(
"");
700 for (
int i=Ev_start; i< Ev_end; i++) {
701 fTask->ExecuteTask(
"");
713 cout <<
"FairRunAna::RunOnProof(" << NStart <<
"," << NStop <<
"): "
714 <<
"running FairAnaSelector on proof server: \"" <<
fProofServerName.Data() <<
"\" "
715 <<
"with PAR file name = \"" <<
fProofParName.Data() <<
"\"." << endl;
721 TString par1File =
"";
722 TString par2File =
"";
745 fProof->AddInput(
new TNamed(
"FAIRRUNANA_fContainerStatic",(
fStatic?
"kTRUE":
"kFALSE")));
747 fProof->AddInput(
new TNamed(
"FAIRRUNANA_fOutputDirectory",outDir.Data()));
748 fProof->AddInput(
new TNamed(
"FAIRRUNANA_fOutputFileName",outFile.Data()));
749 fProof->AddInput(
new TNamed(
"FAIRRUNANA_fParInput1FName",par1File.Data()));
750 fProof->AddInput(
new TNamed(
"FAIRRUNANA_fParInput2FName",par2File.Data()));
752 cout <<
"0309: ClearPackages" << endl;
754 cout <<
"0309: UploadPackages" << endl;
756 cout <<
"0309: EnablePackages" << endl;
758 cout <<
"0309: ShowPackages" << endl;
760 cout <<
"0309: Done" << endl;
762 Int_t nofChainEntries = inChain->GetEntries();
763 cout <<
"FairRunAna::RunOnProof(): The chain seems to have " << nofChainEntries <<
" entries." << endl;
765 TObjArray* listOfFiles = inChain->GetListOfFiles();
766 cout <<
"FairRunAna::RunOnProof(): There are " << listOfFiles->GetEntries() <<
" files in the chain." << endl;
770 Int_t nofEventsToAnalyze = NStop-NStart;
772 if ( nofEventsToAnalyze <= 0 ) {
773 cout <<
"You requested to analyze events from " << NStart <<
" to " << NStop <<
" that is " << nofEventsToAnalyze <<
" events!!!" << endl;
774 nofEventsToAnalyze = nofChainEntries-NStart;
775 cout <<
"It will be changed to analyze all events from " << NStart <<
" to the end of chain (" << nofChainEntries <<
"), that is to analyze " << nofEventsToAnalyze <<
" events." << endl;
778 cout <<
"FairRunAna::RunOnProof(): Starting inChain->Process(\"FairAnaSelector\",\"\","
779 << nofEventsToAnalyze <<
"," << NStart <<
")" << endl;
780 inChain->Process(
"FairAnaSelector",
"",nofEventsToAnalyze,NStart);
781 cout <<
"FairRunAna::RunOnProof(): inChain->Process DONE" << endl;
874 if (ROOT_VERSION_CODE >= ROOT_VERSION(5,29,1)) {