// %%%%%%%%%%%%% // gemc headers // %%%%%%%%%%%%% #include "bst_strip.h" #include #include #include void bst_strip::fill_infos() { // all dimensions are in mm Pi = 3.14159265358; interlayer = 2.75; // distance between 2 layers of a superlayer alpha = 1.5*Pi/180; // angle of the strips pitch = 0.150; // pitch of the strips // number of sectors for each layer Nsector.push_back(8); Nsector.push_back(8); Nsector.push_back(12); Nsector.push_back(12); Nsector.push_back(18); Nsector.push_back(18); Nsector.push_back(24); Nsector.push_back(24); // number of cards by sector for each layer Ncards.push_back(1); Ncards.push_back(1); Ncards.push_back(2); Ncards.push_back(2); Ncards.push_back(3); Ncards.push_back(3); Ncards.push_back(3); Ncards.push_back(3); // z of the upstream part of the layer Z0.push_back(-39.219); Z0.push_back(-39.219); Z0.push_back(-111.319); Z0.push_back(-111.319); Z0.push_back(-164.787); Z0.push_back(-164.787); Z0.push_back(-107.070); Z0.push_back(-107.070); // radii of layers R.push_back(101.129/2); R.push_back(R[0]+interlayer); R.push_back(156.853/2); R.push_back(R[2]+interlayer); R.push_back(238.869/2); R.push_back(R[4]+interlayer); R.push_back(320.268/2); R.push_back(R[6]+interlayer); // mid angle of the sector MidTile.push_back(0); MidTile.push_back(0); MidTile.push_back(0); MidTile.push_back(0); MidTile.push_back(Pi/18); MidTile.push_back(Pi/18); MidTile.push_back(0); MidTile.push_back(0); DZ_inLength = 0.934; // size of the band of dead zones all around in the length of the card DZ_inWidth = 0.934; // size of the band of dead zones all around in the width of the card CardLength = 111.625; // length of 1 card CardWidth = 41.7; // width 1 card // Number of strips NstripsZ = (int) floor((CardWidth-2.0*DZ_inLength-(CardLength-2*DZ_inWidth)*tan(alpha))*cos(alpha)/pitch); Nstrips = (int) floor((CardWidth-2.0*DZ_inLength)/pitch); } void bst_strip::FindCard(int layer, double Z) { if(Z>Z0[layer] && ZZ0[layer]+CardLength) { cout << " Warning: z not within first card. This should never happen! z = " << z << ", card = " << nCard << endl; exit(0); } } } int bst_strip::FindStripZ(int layer, int sector, double X, double Y) { x = X; y = Y; double mindist = 999.; // min distance between the points and strips double dist = 999.; // distance to current strip int ClosestStrip = -1; // number of the closest strip int IsOK = 0; const int MAXNSTRIP = 1024; if(NstripsZ > MAXNSTRIP) { cout << " Warning: number of strips > 1024. Exiting. " << endl; exit(0); } double Px[MAXNSTRIP], Py[MAXNSTRIP], Pz[MAXNSTRIP]; double Pxp[MAXNSTRIP], Pyp[MAXNSTRIP], Pzp[MAXNSTRIP]; for(int k=0; kZ0[layer]+DZ_inWidth && z MAXNSTRIP) { cout << " Warning: number of strips > 1024. Exiting. " << endl; exit(0); } double Px[MAXNSTRIP], Py[MAXNSTRIP], Pz[MAXNSTRIP]; double Pxp[MAXNSTRIP], Pyp[MAXNSTRIP], Pzp[MAXNSTRIP]; double alpha_k; // particle is in the z-acceptance if(z>Z0[layer]+DZ_inWidth && zZ0[layer]+DZ_inWidth && z