void runDistMapping_sa(TString tpcFile, TString cdcFile, TString outFile, unsigned int nEvents) { // ======================================================================== // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug) Int_t iVerbose = 1; TStopwatch timer; timer.Start(); // Load basic libraries in rootlogon gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C"); rootlogon(); TString basedir = gSystem->Getenv("VMCWORKDIR"); FairRunAna* fRun = new FairRunAna(); fRun->SetOutputFile(outFile); FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParAsciiFileIo* parInput1 = new FairParAsciiFileIo(); TString digiFile = basedir; digiFile+="/tpc/TestBench/tpc.TBtestChamber.par"; parInput1->open(digiFile.Data(),"in"); rtdb->setFirstInput(parInput1); rtdb->Print(); TString geoFile = basedir; geoFile+="/tpc/TestBench/FOPIGeo.root"; fRun->SetGeomFile(geoFile); PndConstField *fMagField=new PndConstField(); fMagField->SetField(0., 0. , 6. ); // values are in kG // values are in cm fMagField->SetFieldRegion(-50, 50,-50, 50, -2000, 2000); fRun->SetField(fMagField); //extract number of entries in external data tree TFile testFile(tpcFile); unsigned int numEvents = ((TTree*)testFile.Get("tpcEvent"))->GetEntries(); std::cout<<"Found "<numEvents) nEvents=numEvents; //--------------------SET UP TASKS ------------------------------ FairGeane *Geane = new FairGeane(); fRun->AddTask(Geane); TpcDataReaderTask* read = new TpcDataReaderTask(); read->SetPersistence(); read->SetDatafile(tpcFile); read->SetClusterBranchName("TpcSample"); //read->SetCutSmallPad(); //read->SetMinSamples(1000); fRun->AddTask(read); FopiDataReaderTask* cdcRead = new FopiDataReaderTask(); cdcRead->SetInputFile(cdcFile); //CHANGES OVER FRANCESCOS RECO FILES! BEWARE! cdcRead->SetCdcTreeName("cbmsim"); cdcRead->SetCdcTrackInBranchName("TpcCdcTrack"); cdcRead->SetCdcEventInBranchName("TpcCdcEvent"); cdcRead->SetCdcHitInBranchName("TpcCdcHit"); fRun->AddTask(cdcRead); TpcPSATask* tpsa = new TpcPSATask(); tpsa->SetPersistence(); tpsa->SetSampleBranchName("TpcSample"); // Input of PSA fRun->AddTask(tpsa); //bool SimpleClustering = true; TpcClusterFinderTask* tpcCF = new TpcClusterFinderTask(); tpcCF->SetDigiPersistence(); // keep Digis refs in clusters tpcCF->SetPersistence(); // keep Clusters tpcCF->timeslice(6); //in samples tpcCF->SetSingleDigiClusterAmpCut(20); tpcCF->SetClusterAmpCut(9.1); // cut on mean digi amplitude tpcCF->SetErrorPars(600,400); tpcCF->SetSimpleClustering(); // use TpcClusterFinderSimple fRun->AddTask(tpcCF); //mickey mouse MC creating CDC tracks and (shifted) TpcClusters TpcMMLocalGaussDistortion dist(0.2,TVector3(0.,0.6,0.),TVector3(14.,0.0.)); TpcMickeyMouseMCTask* mickey = new TpcMickeyMouseMCTask(); mickey->SetPersistence(); mickey->SetTrackOutBranch("MickeyTrack"); mickey->SetClusterOutBranch("MickeyCluster"); //mickey->SetRandomSmear(0.2,0.2,0.2); //mickey->SetGlobRotationAngle(TMath::Pi()/180*2); mickey->AddDistorter(&dist); //fRun->AddTask(mickey); //the actual calculator: TpcCdcFit2DResCalc* cdc2d = new TpcCdcFit2DResCalc(); cdc2d->addBranchName("FopiCdcTrack"); cdc2d->addBranchName("TpcCluster"); //just a test //cdc2d->addBranchName("MickeyCluster"); //just a test //cdc2d->addBranchName("MickeyTrack"); cdc2d->setDistanceCut(10.); //the task: TpcRefTrackResidualTask* res = new TpcRefTrackResidualTask(); res->SetResCalculator(cdc2d); res->SetPersistence(); fRun->AddTask(res); //they see it right, they see it well ... // ----- Intialise and run -------------------------------------------- fRun->Init(); fRun->Run(0,nEvents); timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime); std::cout<<"OutputFile: "<