//////////////////////////////////// // KRATTA Event analyser // for the Asy-Eos experiment // TKratAnaStep1 DECLARATION // Nov 2012 // revison 11/2012 // E.d.F ver 1.0 // sebastian.kupny@uj.edu.pl // jerzy.lukasik@ifj.edu.pl // Changes: //////////////////////////////////// #include "TKratAnaStep2.h" using std::cout; using std::endl; TKratAnaStep2::TKratAnaStep2() : FairTask("R3B Land Digitization scheme ") { fVerbose = 1; } TKratAnaStep2::TKratAnaStep2(Int_t verbose) : FairTask("R3B Land Digitization scheme ", verbose) { fVerbose = verbose; fKratContInName = "KRATTA_EVENT_PARAM_CLONE"; } TKratAnaStep2::~TKratAnaStep2() { } void TKratAnaStep2::SetParContainers() { // Get run and runtime database FairRunAna* run = FairRunAna::Instance(); if ( ! run ) Fatal("SetParContainers", "No analysis run"); FairRuntimeDb* rtdb = run->GetRuntimeDb(); if ( ! rtdb ) Fatal("SetParContainers", "No runtime database"); } InitStatus TKratAnaStep2::Init() { // Get input array FairRootManager* ioman = FairRootManager::Instance(); if ( ! ioman ) Fatal("Init", "No FairRootManager"); fASYEventCopy = (TClonesArray*) ioman->GetObject( fKratContInName ); fASYEvent = (ASYEvent*) fASYEventCopy; /// Check existance the input necessary data container if (fASYEventCopy==NULL){ cout << "[TKratAnaStep2::Init Error:] Couldn't find necessary input data container with name: " << fKratContInName << " (of class ASYEvent)."; cout << " It may breaks the analysis." << endl; getchar(); } cout << "[TKratAnaStep2:] Init()" << endl; if ( ! gGeoManager )cout << "Init " << " No GeoManager"<Register("FASTSLOW", "Sim Fast Slow", fs, kTRUE); */ return kSUCCESS; } // ------------------------------------------------------------------------- // ----- Public method Exec -------------------------------------------- void TKratAnaStep2::Exec(Option_t* opt) { /* cout<<"new event...................... PARAM: "; cout << " run = " << fASYEvent->run; cout << ", evt = " << fASYEvent->evt; cout << ", npeak = " << fASYEvent->npeak; cout << ", tms = " << fASYEvent->tms; cout << endl; */ cout << "\r\r\r\rEvent = " << fASYEvent->evt; /* double de[352],dlight[352],dslow[352]; for (int i=0;i<352;i++){de[i]=0;dlight[i]=0;dslow[i]=0;} Int_t nentries = fKrattaPoints->GetEntries(); cout<<" entries =" << nentries <At(l); // Int_t paddle = int(land_obj->GetSector())-1; //note that paddle starts at 1 // Int_t scint = int(land_obj->GetPaddleNb()); Double_t eloss = fKratta_obj->GetEnergyLoss()*1000.; Double_t light = fKratta_obj->GetLightYield()*1000.; Double_t slow = fKratta_obj->GetSlow()*1000.; Double_t xIn = fKratta_obj->GetXIn(); Double_t yIn = fKratta_obj->GetYIn(); Double_t zIn = fKratta_obj->GetZIn(); Double_t xOut = fKratta_obj->GetXOut(); Double_t yOut = fKratta_obj->GetYOut(); Double_t zOut = fKratta_obj->GetZOut(); Double_t time = fKratta_obj->GetTime(); Int_t detID = fKratta_obj->GetDetectorID(); // Int_t media = int(land_obj->GetPaddleType()); TrackId = fKratta_obj->GetTrackID(); R3BMCTrack *aTrack = (R3BMCTrack*) fKrattaMCTrack->At(TrackId); Int_t PID = aTrack->GetPdgCode(); Int_t mother = aTrack->GetMotherId(); // cout <<" TrackId " << TrackId << " PID = "<< PID << " mother = " << mother << // " ELoss " << eloss << " light " << light <<" slow " << slow <<" detid = "<< detID; if(!gGeoManager) cout << " gGeoManager missing" << endl; gGeoManager->FindNode(xIn,yIn,zIn); TGeoNode* curNode = gGeoManager->GetCurrentNode(); Int_t ntel=curNode->GetNumber(); cout << " " << curNode->GetNumber() <Gaus(light,light*0.001/2.35); dlight[ntel]=dlight[ntel]+lR; Double_t sR=gRandom->Gaus(slow,slow*0.001/2.35); dslow[ntel]=dslow[ntel]+sR; // cout << " " << ntel <<" "<1000020040)ratio=0.8; if(PID==1000020040)ratio=0.8; if(PID==1000020030)ratio=0.8; if(PID==1000010030)ratio=0.8; if(PID==1000010020)ratio=0.8; if(PID==2212)ratio=0.8; if(PID==22)ratio=0.8; // dslow[ntel] =dslow[ntel] +5*(light-eloss*ratio); // cout << gMC->TrackCharge()<Fill(dlight[30]); hEnergy->Fill(de[30]); hLightEnergy->Fill(de[30],dlight[30],1.); hFS->Fill(dslow[30],dlight[30],1.); hLight2->Fill(dlight[35]); hEnergy2->Fill(de[35]); hLightEnergy2->Fill(de[35],dlight[35],1.); hFS2->Fill(dslow[35],dlight[35],1.); hLight3->Fill(dlight[0]); hEnergy3->Fill(de[0]); hLightEnergy3->Fill(de[0],dlight[0],1.); hFS3->Fill(dslow[0],dlight[0],1.); hLight4->Fill(dlight[5]); hEnergy4->Fill(de[5]); hLightEnergy4->Fill(de[5],dlight[5],1.); hFS4->Fill(dslow[5],dlight[5],1.); hLight5->Fill(dlight[10]); hEnergy5->Fill(de[10]); hLightEnergy5->Fill(de[10],dlight[10],1.); hFS5->Fill(dslow[10],dlight[10],1.); int ifired=0; for(int i=0;i<352;i++){ // if(dslow[i]>800)dslow[i]=800; // if(dlight[i]>1100)dlight[i]=1100; if(dslow[i]>0 && dlight[i]>0){ hFSTot->Fill(dslow[i],dlight[i],1.); fs->fast[ifired]=dlight[i]; fs->slow[ifired]=dslow[i]; fs->de[ifired]=de[i]; fs->numtel[ifired]=i; ifired++; } } fs->multi=ifired; */ } // ------------------------------------------------------------------------- void TKratAnaStep2::Reset(){ // Clear the structure // cout << " -I- Digit Reset() called " << endl; //pc if (fLandDigi ) fLandDigi->Clear(); } void TKratAnaStep2::Finish() { /* hLight->Write(); hEnergy->Write(); hLightEnergy->Write(); hFS->Write(); hLight2->Write(); hEnergy2->Write(); hLightEnergy2->Write(); hFS2->Write(); hLight3->Write(); hEnergy3->Write(); hLightEnergy3->Write(); hFS3->Write(); hLight4->Write(); hEnergy4->Write(); hLightEnergy4->Write(); hFS4->Write(); hLight5->Write(); hEnergy5->Write(); hLightEnergy5->Write(); hFS5->Write();hFSTot->Write(); */ } ClassImp( TKratAnaStep2 )