#include "Utilities/Configuration/interface/Architecture.h" #include "CommonDet/BasicDet/interface/DetType.h" #include "CommonDet/BasicDet/interface/Det.h" #include "CommonDet/BasicDet/interface/Enumerators.h" #include "CommonDet/BasicDet/interface/DetUnit.h" #include "CommonDet/DetLayout/interface/DetLayer.h" #include "Tracker/TkLayout/interface/FullTracker.h" #include "CuTkBuilderInORCA.h" #include "Tracker/TkLayout/interface/FullTracker.h" #include "Tracker/TkLayout/interface/CmsTracker.h" #include #include void CuTkBuilderInORCA::fill() { int spicchif[] ={24,24,40,56,40,56,80}; int spicchib[] ={18,30,42,30,38,46,56,42,48,54,60,66,74}; const CmsTracker::LayerContainer& theLayerContainer = FullTracker::instance()->forwardLayers(); CmsTracker::layer_p_iter iLay; int det_type=0; int nlay=0; int nmod1=0; int anello = 0; int nmod = 0; int ntotmod = 0; float r; int bar_fow = 1; float phi,phi1; //float hbotedge, htopedge, hapothem, hthickness; float rmedioS[]={0.27665, 0.3671, 0.4474, 0.5617, 0.6768, 0.8189, 0.9907}; float rmedioP[]={0.0643018, 0.0763302, 0.0896792, 0.106088, 0.118808, 0.135627, 0.143702}; for (iLay = theLayerContainer.begin(); iLay != theLayerContainer.end(); iLay++) { nlay++; Module layer_type = (*iLay)->module(); const CmsTracker::DetContainer theDetContainer = (*iLay)->detUnits(); CmsTracker::det_p_iter iDet; for (iDet = theDetContainer.begin() ; iDet != theDetContainer.end() ; iDet++) { float posx = (*iDet)->surface().position().x()/ 100.0; // cm -> m float posy = (*iDet)->surface().position().y()/ 100.0; // cm -> m float posz = (*iDet)->surface().position().z()/ 100.0; // cm -> m r=pow(((double)(posx*posx) + posy*posy),0.5); phi1=atan(posy/posx); phi=phi1; if(posy < 0.&&posx>0)phi=phi1+2.*3.1415; if(posx < 0.)phi=phi1+3.1415; if(fabs(posy)<0.000001&&posx>0)phi=0; if(fabs(posy)<0.000001&&posx<0)phi=3.1415; if(fabs(posx)<0.000001&&posy>0)phi=3.1415/2.; if(fabs(posx)<0.000001&&posy<0)phi=3.1415 + 3.1415/2.; det_type=1; if (layer_type==silicon) { det_type=2; for (int i=0;i<7; i++){ if (fabs(r-rmedioS[i])<0.015){ anello =i+1; break; } } nmod=(int)((phi/(2.*3.1415))*spicchif[anello-1]+.1)+1; } else{ for (int i=0; i<7; i++){ if(fabs(r -rmedioP[i])<0.0001){ anello=i+1; break; } } nmod=(int)((phi/(2.*3.1415))*24+.1)+1; } if (layer_type==silicon && (*iDet)->type().isStereo()) nmod=nmod+100; ntotmod++; bar_fow=1; if(nlay>14)bar_fow=3; float length = (*iDet)->type ().bounds ().length () / 100.0; // cm -> m float width = (*iDet)->type ().bounds ().width () / 100.0; // cm -> m float thickness = (*iDet)->type ().bounds ().thickness () / 100.0; // cm -> m float widthAtHalfLength = (*iDet)->type ().bounds ().widthAtHalfLength () / 100.0; cout<< ntotmod << " " << det_type << " " << bar_fow << " " <barrelLayers(); CmsTracker::layer_p_iter iLay1; nmod1=0; nmod = 0; //float oldz; for (iLay1 = theLayerContainer1.begin(); iLay1 != theLayerContainer1.end(); iLay1++) { nlay++; anello = -1; Module layer_type1 = (*iLay1)->module(); const CmsTracker::DetContainer theDetContainer1 = (*iLay1)->detUnits(); CmsTracker::det_p_iter iDet1; for (iDet1 = theDetContainer1.begin() ; iDet1 != theDetContainer1.end() ; iDet1++) { float posx1 = (*iDet1)->surface().position().x()/ 100.0; // cm -> m float posy1 = (*iDet1)->surface().position().y()/ 100.0; // cm -> m float posz1= (*iDet1)->surface().position().z()/ 100.0; // cm -> m if (anello == -1){ oldz = posz1; anello = 1; } else{ if((nlay<36 && fabs(oldz - posz1) > 0.001) ||( nlay>35 && fabs(oldz - posz1) > 0.05 )){ oldz = posz1; anello++; } } r=pow(((double)(posx1*posx1) + posy1*posy1),0.5); phi1=atan(posy1/posx1); phi=phi1; if(posy1 < 0.&&posx1>0)phi=phi1+2.*3.1415; if(posx1 < 0.)phi=phi1+3.1415; if(fabs(posy1)<0.000001&&posx1>0)phi=0; if(fabs(posy1)<0.000001&&posx1<0)phi=3.1415; if(fabs(posx1)<0.000001&&posy1>0)phi=3.1415/2.; if(fabs(posx1)<0.000001&&posy1<0)phi=3.1415 + 3.1415/2.; nmod=(int)((phi/(2.*3.1415))*spicchib[nlay-29]+.1)+1; det_type=1; if (layer_type1==silicon) det_type=2; if (layer_type1==silicon && (*iDet1)->type().isStereo()) nmod=nmod+100; //const vector par = (*iDet1)->type().shape().parameters(); ntotmod++; bar_fow=2; float length = (*iDet1)->type ().bounds ().length () / 100.0; // cm -> m float width = (*iDet1)->type ().bounds ().width () / 100.0; // cm -> m float thickness = (*iDet1)->type ().bounds ().thickness () / 100.0; // cm -> m float widthAtHalfLength = (*iDet1)->type ().bounds ().widthAtHalfLength () / 100.0; cout << ntotmod << " " << det_type << " " << bar_fow << " " <