#include "tpc/TpcGem.h" #include "tpc/TpcPadPlane.h" #include "tpc/TpcPadShapePool.h" #include "tpc/TpcSignal.h" #include "tpc/TpcDigi.h" #include "tpc/TpcDriftedElectron.h" #include "tpc/TpcAvalanche.h" #include "TFile.h" #include "TClonesArray.h" #include "TTree.h" #include "TH2D.h" #include "TH1D.h" #include "TH1I.h" #include "TH2I.h" #include "TStyle.h" #include void plotDigiOutput(char* filename){ gStyle->SetFillColor(kWhite); TFile* file = new TFile(filename); TTree *t=(TTree*)file->Get("cbmsim") ; if(t==NULL){ std::cout<<"Data tree not found. Aborting." <SetBranchAddress("TpcDriftedElectron",&da); //Get Avalanches TClonesArray *aa=new TClonesArray("TpcAvalanche"); t->SetBranchAddress("TpcAvalanche",&aa); //Get Signals TClonesArray *sa=new TClonesArray("TpcSignal"); t->SetBranchAddress("TpcSignal",&sa); //Get Signals TClonesArray *diga=new TClonesArray("TpcDigi"); t->SetBranchAddress("TpcDigi",&diga); // Event loop Int_t nevents=t->GetEntriesFast(); for (Int_t j=0; jGetEntry(j); // look at drifted electrons ------------------------------------------ Int_t nde=da->GetEntriesFast(); for (Int_t i=0; iAt(i); double x,y,t; x=de->x(); y=de->y(); t=de->t(); // look through all other electrons for(Int_t i2=i+1; i2At(i2); double dx=x-de2->x(); double dy=y-de2->y(); double dt=t-de2->t(); double dr=sqrt(dx*dx+dy*dy); de_dist_H->Fill(dr); if(dr<0.3)de_dt_H->Fill(fabs(dt)); } } // look at avalanches -------------------------------------- Int_t nav=aa->GetEntriesFast(); for (Int_t i=0; iAt(i); double x,y,t; x=a->x(); y=a->y(); t=a->t(); // look through all other electrons for(Int_t i2=i+1; i2At(i2); double dx=x-a2->x(); double dy=y-a2->y(); double dt=t-a2->t(); double dr=sqrt(dx*dx+dy*dy); av_dist_H->Fill(dr); if(dr<0.3)av_dt_H->Fill(fabs(dt)); } } //look at signals --------------------------------------------------- Int_t nsig=sa->GetEntriesFast(); // map of hit pads -> how often has one pad been hit? std::map hitpads; for (Int_t i=0; iAt(i); unsigned int id=sig->padId(); (hitpads[id])++; } std::map::iterator padit=hitpads.begin(); while(padit!=hitpads.end()){ nsig_per_pad_H->Fill((*padit).second); ++padit; } //look at Digis Int_t ndigi=diga->GetEntriesFast(); // map of hit pads -> what are the times between digis? std::map digitimes; for (Int_t i=0; iAt(i); unsigned int id=digi->padId(); unsigned int t=digi->t(); if(t==0)std::cout<<"warning t==0!"<Fill(dt); digi_tdt_H->Fill(dt,t); } digitimes[id]=t; } } // end event loop }