#include "tpc/TpcGem.h" #include "tpc/TpcPadPlane.h" #include "tpc/TpcPadShapePool.h" #include "tpc/TpcSignal.h" #include "TFile.h" #include "TClonesArray.h" #include "TTree.h" #include "TH2D.h" #include "TStyle.h" void plotSignals(){ gStyle->SetFillColor(kWhite); //TODO: Get these things from Database!!! TpcGem* _gem=new TpcGem(5000, // Gain 0.02); // Spread TpcPadShapePool* _padShapes = new TpcPadShapePool("Hexagons0.2.dat", *_gem, 0.5, // lookup range 0.02, // Lookup Step 0.01); // LookupIntegrationStep TpcPadPlane* _padPlane=new TpcPadPlane("pndhexplane.dat", _padShapes); TFile* file = new TFile("/afs/e18/data/panda/MC/FAIRRoot/DPM1/sigSlice1/test1.sig.root"); //TGeoManager *geoMan = (TGeoManager*) file->Get("CBMGeom"); TTree *t=(TTree*)file->Get("cbmsim") ; TClonesArray *sa=new TClonesArray("TpcSignal"); t->SetBranchAddress("TpcSignal",&sa); TH2D* ma=new TH2D("map","Hit pads",420,-42,42,420,-42,42); for (Int_t j=0; j< t->GetEntriesFast(); j++) { t->GetEntry(j); for (Int_t i=0; iGetEntriesFast(); i++) { TpcSignal *sig=(TpcSignal*)sa->At(i); double x,y; _padPlane->GetPadXY(sig->padId(),x,y); ma->Fill(x,y); } } ma->Draw("BOX"); }