#include #include #include"tpcEvent.h" #include"TApplication.h" #include"TGraph.h" #include"TCanvas.h" #include"TPolyMarker3D.h" #include"TSystem.h" #include "SignalAnalysis.h" #include "../Mapping.h" #include "LcardMapping.h" int main(int argc,char **argv){ assert(argc==2); TApplication theApp("theApp",NULL,NULL); TFile::Open(argv[1]); TTree *tree = (TTree*)gROOT->FindObject("datatree"); tpcEvent e(tree); Mapping hexMap; LcardMapping lMap; hexMap.read("../gem_mapping2.txt"); lMap.read("igor2.txt"); // void map(unsigned int conn, unsigned int pin, double& x, double& y){ // bool map(unsigned int chip,unsigned int ch,unsigned int& pin){ while(e.loadNext()){ UInt_t amps[76][255]; std::vector pulses[76]; int counter[76]; for(int i=0;i<76;++i) counter[i]=0; int nPulses=0; int nChannels=0; for(int i=0;ich = i; } nPulses+=pulses[i].size(); if(pulses[i].size()>0)nChannels+=1; } double x[nPulses]; double y[nPulses]; int pulsCounter = 0; for(int j=0;j<76;++j){ for(int k=0;kstartTime; y[pulsCounter++] = j; } } if(nPulses>0){ static int rootCounter = 0; char buf2[50]; sprintf(buf2,"graph%d",rootCounter++); TCanvas *c = new TCanvas(); c->SetName(buf2); TGraph *g = new TGraph(nPulses,x,y); char buf[50]; static int eventCounter(0); sprintf(buf,"event %d",eventCounter++); sprintf(buf2,"graph%d",rootCounter++); g->SetName(buf2); g->SetTitle(buf); g->Draw("A*"); gApplication->SetReturnFromRun(kTRUE); gSystem->Run(); gROOT->Reset(); delete g; delete c; } std::cout << nPulses << " " << nChannels << std::endl; std::vector X; std::vector Y; std::vector T; for(int i=0;i<76;++i){ for(int j=0;jch,pin)) continue; std::cout << chip << " " << pulses[i].at(j)->ch << " " << pin << std::endl; double x,y; hexMap.map(conn,pin,x,y); X.push_back(x); Y.push_back(y); T.push_back(pulses[i].at(j)->startTime); } } int nPoints = X.size(); TPolyMarker3D* pm = new TPolyMarker3D(nPoints); for(int i=0;iSetPoint(i,X.at(i),Y.at(i),T.at(i)); } pm->Draw(); }//end of event loop }