#include "Riostream.h" void geom() { gROOT->Reset(); gSystem->Load("libGeom"); /* TGeoManager *gGeoManager=new TGeoManager("world","geometry"); TGeoMaterial *mat = new TGeoMaterial("Vacuum",0,0,0); TGeoMedium *med = new TGeoMedium("Vacuum",1,mat); TGeoVolume *top=gGeoManager->MakeBox("Top",med,1500,2500,1000); gGeoManager->SetTopVolume(top); TGeoBBox *tankbox = new TGeoBBox("tankbox",50,75,50); TGeoVolume *tank1=new TGeoVolume("Tank",tankbox); TGeoVolume *tank2=new TGeoVolume("Tank",tankbox); TGeoVolume *tank3=new TGeoVolume("Tank",tankbox); TGeoVolume *tank4=new TGeoVolume("Tank",tankbox); TGeoVolume *tank5=new TGeoVolume("Tank",tankbox); TGeoVolume *tank6=new TGeoVolume("Tank",tankbox); TGeoVolume *tank7=new TGeoVolume("Tank",tankbox); tank1->SetLineColor(2); tank1->SetLineWidth(4); tank2->SetLineWidth(4); tank2->SetLineColor(42); tank3->SetLineWidth(4); tank3->SetLineColor(5); tank4->SetLineWidth(4); tank4->SetLineColor(3 ); tank5->SetLineWidth(4); tank5->SetLineColor(4); tank6->SetLineWidth(4); tank6->SetLineColor(6); tank7->SetLineStyle(2); tank7->SetLineColor(1); tank7->SetTransparency(50); //tank7->SetInvisible(); //TGeoVolume *family=gGeoManager->Volume("Tank","box",0); */ ifstream in,in2; ofstream of; TList* geometries = new TList; Float_t x[841],y[841],z[841]; Float_t xx,yy,zz; Int_t num[841],nid,i=0,evid,tclp; Int_t numm,num_co; Float_t ener,enet; char effStr[60]; TGeoNode *cnode; TGeoVolume *cvol; char *cnam; // opening a file with counters' coordinates in.open("tower31.dat"); //of.open("/nfs/lvdusr/boyarkin/nodes.dat",ios::out|ios::trunc); while(!in.eof()) { in>>num[i]>>x[i]>>y[i]>>z[i];i++;}; Int_t ntot = i; in.close(); TView *view; TCanvas *can1=new TCanvas("can1","LVD view",810,10,1110,710); can1->SetFillColor(23); // TView *view=new TView(1); TPad *pad1=new TPad("pad1","side",.02,.02,.48.,.58); TPad *pad2=new TPad("pad2","front",.52,.02,.98,.58); TPad *pad3=new TPad("pad3","labels",.05,.62,.95,.98); pad1->SetFillColor(19); pad2->SetFillColor(19); pad3->SetFillColor(18); pad1->SetTheta(90); pad1->SetPhi(270); pad2->SetTheta(0); pad2->SetPhi(270); pad1->Draw(); pad2->Draw(); pad3->Draw(); // opening a file with recorded events in2.open("sci_hits.dat"); can1->Print("muons.ps["); //opening a file to print all canvases while(!in2.eof()){ if (gGeoManager) { geometries->Add(gGeoManager); gGeoManager = 0; } new TGeoManager("world","geometry"); TGeoMaterial *mat = new TGeoMaterial("Vacuum",0,0,0); TGeoMedium *med = new TGeoMedium("Vacuum",1,mat); TGeoVolume *top=gGeoManager->MakeBox("Top",med,1500,2500,1000); gGeoManager->SetTopVolume(top); TGeoBBox *tankbox = new TGeoBBox("tankbox",50,75,50); TGeoVolume *tank1=new TGeoVolume("Tank",tankbox); TGeoVolume *tank2=new TGeoVolume("Tank",tankbox); TGeoVolume *tank3=new TGeoVolume("Tank",tankbox); TGeoVolume *tank4=new TGeoVolume("Tank",tankbox); TGeoVolume *tank5=new TGeoVolume("Tank",tankbox); TGeoVolume *tank6=new TGeoVolume("Tank",tankbox); TGeoVolume *tank7=new TGeoVolume("Tank",tankbox); tank1->SetLineColor(2); tank1->SetLineWidth(4); tank2->SetLineWidth(4); tank2->SetLineColor(42); tank3->SetLineWidth(4); tank3->SetLineColor(5); tank4->SetLineWidth(4); tank4->SetLineColor(3); tank5->SetLineWidth(4); tank5->SetLineColor(4); tank6->SetLineWidth(4); tank6->SetLineColor(6); tank7->SetLineStyle(2); tank7->SetLineColor(1); tank7->SetTransparency(50); in2>>evid>>tclp>>ener; printf("evid=%d, tclp=%d, ener=%f\n",evid,tclp,ener); if(ener>0){ enet+=ener; num_co++; for(i=0;iAddNode(tank6,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); // different colours for different energy releases /* if(tclp==num[i]){ cout<<"coincidence with "<50) top->AddNode(tank1,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); else if(ener>30) top->AddNode(tank2,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); else if(ener>20) top->AddNode(tank3,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); else if(ener>10) top->AddNode(tank4,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); else if(ener>5) top->AddNode(tank5,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); else if(ener>0) top->AddNode(tank6,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100)); } else top->AddNode(tank7,num[i], new TGeoTranslation(x[i]*100,y[i]*100,z[i]*100));*/ } gGeoManager->CloseGeometry(); pad1->cd(); gGeoManager->GetMasterVolume()->Draw(); view=pad1->GetView(); view->Zoom(); view->SetParallel(); pad1->Modified(); pad1->Update(); pad2->cd(); gGeoManager->GetMasterVolume()->Draw(); } else { // and of event => so drawing the results pad3->cd(); TText t1(0,0,"a"); t1.SetTextFont(72); t1.SetTextSize(0.15); t1.SetTextAlign(12); t1.SetTextColor(46); t1.DrawText(0.1,0.92,"LVD top and side views"); t1.SetTextFont(62); t1.SetTextSize(0.1); t1.DrawText(0.7,0.9,"Energy Scale:"); t1.SetTextFont(51); t1.SetTextSize(0.08); t1.SetTextColor(1); t1.DrawText(0.72,0.73,">50"); t1.DrawText(0.72,0.65,">30"); t1.DrawText(0.72,0.57,">20"); t1.DrawText(0.72,0.49,">10"); t1.DrawText(0.72,0.41,">5"); t1.DrawText(0.72,0.33,">0"); t1.DrawText(0.72,0.25,"no release"); TBox *box1=new TBox(0.65,0.76,0.70,0.70); box1->SetFillColor(2); box1->Draw(); TBox *box2=new TBox(0.65,0.68,0.70,0.62); box2->SetFillColor(42); box2->Draw(); TBox *box3=new TBox(0.65,0.60,0.70,0.54); box3->SetFillColor(5); box3->Draw(); TBox *box4=new TBox(0.65,0.52,0.70,0.46); box4->SetFillColor(3); box4->Draw(); TBox *box5=new TBox(0.65,0.44,0.70,0.38); box5->SetFillColor(4); box5->Draw(); TBox *box6=new TBox(0.65,0.36,0.70,0.30); box6->SetFillColor(6); box6->Draw(); TBox *box7=new TBox(0.65,0.28,0.70,0.22); box7->SetFillStyle(3003); box7->SetFillColor(1); box7->Draw(); TBox *box8=new TBox(0.12,0.74,0.6,0.35); box8->SetFillColor(18); box8->Draw(); t1.SetTextFont(52); t1.SetTextSize(0.1); t1.SetTextColor(4); sprintf(effStr,"Event #%4i",evid); t1.DrawText(0.12,0.70,effStr); sprintf(effStr,"Counters hitted: %2i",num_co); t1.DrawText(0.12,0.55,effStr); sprintf(effStr,"Total energy release: %5.2f MeV",enet); t1.DrawText(0.12,0.40,effStr); pad3->Modified(); pad3->Update(); can1->cd(); can1->Modified(); can1->Print("muons.ps"); //new page in ps-file enet=0; num_co=0; // getchar(); } } can1->Print("muons.ps]"); //closing a ps file }