#include #include #include #include #include "TVector2.h" #include "TpcAbsPadShape.h" #include "TpcPadShapePool.h" #include "TpcPad.h" #include "TpcPadPlane.h" #include "TpcGem.h" void createHexPadPlane(){ double ar=0.2; // hexagone radius double a=ar*1.5; double b=ar*sqrt(3.); // y-grid distance double outerR=42.-0.4; double innerR=15.2; double phislice=5.0*TMath::Pi()/180; int nrows=2*floor(outerR/b); int ncols=2*floor(outerR/a); double startx=-outerR; double starty=startx; int nrings=7; int nslices=32; double dring=(outerR-innerR)/(double)nrings; try{ TpcGem* _gem=new TpcGem(5000, // Gain 0.02); // Spread TpcPadShapePool* _padShapes = new TpcPadShapePool("Hexagons0.2.dat", *_gem, 0.4, // lookup range 0.02, // Lookup Step 0.01); // LookupIntegrationStep TpcAbsPadShape* shape=_padShapes->GetPadShape(0); TpcPadPlane plane(50,50,2,2,-50,-50); int count=0; for(int i=0; iouterR)continue; if(r neighblist; plane.GetPadList(pad->x(),pad->y(),ar*1.01,neighblist); unsigned int nneigh=neighblist.size(); unsigned int c=0; for(int ineigh=0;ineighsectorId()==pad->sectorId() && neighblist[ineigh]->padId()!=pad->padId()){ pad->addNeighbour(neighblist[ineigh]->id()); ++c; } } //std::cout<<"found "<