Changeset df634866 in git
- Timestamp:
- Sep 30, 2014, 5:41:37 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- d2ac201
- Parents:
- 1d42548
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/geometry.C
r1d42548 rdf634866 3 3 #include <utility> 4 4 #include <vector> 5 #include <algorithm> 5 6 #include "TGeoManager.h" 6 7 #include "TGeoVolume.h" … … 39 40 40 41 private: 41 voidaddTracker(TGeoVolume *top);42 void addCalorimeters(TGeoVolume *top);43 void addMuonDets(TGeoVolume *top);44 void addCaloTowers(TGeoVolume *top );42 std::pair<Double_t, Double_t> addTracker(TGeoVolume *top); 43 std::pair<Double_t, Double_t> addCalorimeter(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning); 44 std::pair<Double_t, Double_t> addMuonDets(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength); 45 void addCaloTowers(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning); 45 46 46 47 private: … … 60 61 Double_t tk_length_; 61 62 Double_t tk_etamax_; 62 Double_t calo_endcap_etamax_; 63 Double_t muonSystem_etamax_; 64 Double_t calo_barrel_innerRadius_; 65 Double_t calo_endcap_etamin_; 66 Double_t calo_endcap_innerRadius1_; 67 Double_t calo_endcap_innerRadius2_; 68 Double_t calo_endcap_outerRadius1_; 69 Double_t calo_endcap_outerRadius2_; 70 Double_t calo_endcap_coneThickness_; 71 Double_t calo_endcap_diskThickness_; 72 73 set< pair<Double_t, Int_t> > caloBinning_; 63 64 std::vector<std::string> calorimeters_; 65 std::vector<std::string> muondets_; 66 67 std::map<std::string, Double_t> muonSystem_etamax_; 68 std::map<std::string, set< pair<Double_t, Int_t> > > caloBinning_; 74 69 75 70 }; … … 96 91 calo_barrel_thickness_ = 50.; 97 92 calo_endcap_thickness_ = 75.; 98 muonSystem_thickn_ = contingency_;93 muonSystem_thickn_ = 10.; 99 94 100 95 // read these parameters from the Delphes Card (with default values) … … 102 97 tk_length_ = 150.; 103 98 tk_etamax_ = 3.0; 104 calo_endcap_etamax_ = 2.6;105 muonSystem_etamax_ = 2.4;106 99 } 107 100 … … 138 131 139 132 { 133 muondets_.push_back("muons"); 140 134 TString muonEffFormula = confReader->GetString(Form("%s::EfficiencyFormula",MuonEfficiency),"abs(eta)<2.0"); 141 135 muonEffFormula.ReplaceAll("pt","x"); … … 154 148 bin = etaHisto.FindLastBinAbove(0.5); 155 149 Double_t etamax = (bin>-1) ? etaHisto.GetBinLowEdge(bin+1) : -10.; 156 muonSystem_etamax_ = TMath::Max(fabs(etamin),fabs(etamax));// muonSystem_etamax150 muonSystem_etamax_["muons"] = TMath::Max(fabs(etamin),fabs(etamax)); // muonSystem_etamax 157 151 delete muEffFunction; 158 152 } 159 153 154 std::string s(Calorimeters); 155 std::replace( s.begin(), s.end(), ',', ' ' ); 156 std::istringstream stream( s ); 157 std::string word; 158 while (stream >> word) calorimeters_.push_back(word); 159 160 160 caloBinning_.clear(); // calo binning 161 ExRootConfParam paramEtaBins, paramPhiBins; 162 ExRootConfParam param = confReader->GetParam(Form("%s::EtaPhiBins",Calorimeters)); 163 Int_t size = param.GetSize(); 164 for(int i = 0; i < size/2; ++i) { 165 paramEtaBins = param[i*2]; 166 paramPhiBins = param[i*2+1]; 167 assert(paramEtaBins.GetSize()==1); 168 caloBinning_.insert(std::make_pair(paramEtaBins[0].GetDouble(),paramPhiBins.GetSize()-1)); 169 } 170 171 if (size>0) calo_endcap_etamax_ = TMath::Max(fabs(caloBinning_.begin()->first),fabs(caloBinning_.rbegin()->first)); // calo_endcap_etamax_ 161 for(std::vector<std::string>::const_iterator calo=calorimeters_.begin();calo!=calorimeters_.end(); ++calo) { 162 set< pair<Double_t, Int_t> > caloBinning; 163 ExRootConfParam paramEtaBins, paramPhiBins; 164 ExRootConfParam param = confReader->GetParam(Form("%s::EtaPhiBins",calo->c_str())); 165 Int_t size = param.GetSize(); 166 for(int i = 0; i < size/2; ++i) { 167 paramEtaBins = param[i*2]; 168 paramPhiBins = param[i*2+1]; 169 assert(paramEtaBins.GetSize()==1); 170 caloBinning.insert(std::make_pair(paramEtaBins[0].GetDouble(),paramPhiBins.GetSize()-1)); 171 } 172 caloBinning_[*calo] = caloBinning; 173 } 172 174 173 175 delete confReader; 174 176 175 calo_barrel_innerRadius_ = tk_radius_+contingency_;176 calo_endcap_etamin_ = -log(tk_radius_/(2*tk_length_));177 calo_endcap_innerRadius1_ = tk_length_*2.*exp(-calo_endcap_etamax_)/(1-exp(-2.*calo_endcap_etamax_));178 calo_endcap_innerRadius2_ = (tk_length_+calo_endcap_thickness_)*2.*exp(-calo_endcap_etamax_)/(1-exp(-2.*calo_endcap_etamax_));179 calo_endcap_outerRadius1_ = tk_radius_;180 calo_endcap_outerRadius2_ = tk_radius_+calo_barrel_thickness_;181 calo_endcap_coneThickness_ = calo_barrel_thickness_ * (1-exp(-2.*calo_endcap_etamin_)) / (2.*exp(-calo_endcap_etamin_));182 calo_endcap_diskThickness_ = TMath::Max(0.,calo_endcap_thickness_-calo_endcap_coneThickness_);183 177 } 184 178 … … 186 180 // compute the envelope 187 181 Double_t system_radius = tk_radius_+calo_barrel_thickness_+3*contingency_; 188 Double_t system_length = tk_length_+ TMath::Max(calo_endcap_coneThickness_,calo_endcap_thickness_)+3*contingency_;182 Double_t system_length = tk_length_+contingency_+(contingency_+calo_endcap_thickness_)*calorimeters_.size()+contingency_; 189 183 // the detector volume 190 184 TGeoVolume *top = geom_->MakeBox("Delphes3DGeometry", vacuum_, system_radius, system_radius, system_length); 191 185 // build the detector 192 addTracker(top); 193 addCalorimeters(top); // TODO: allow for more than one calo 194 addMuonDets(top); 195 if (withTowers) { 196 addCaloTowers(top); 186 std::pair<Double_t, Double_t> limits = addTracker(top); 187 Double_t radius = limits.first; 188 Double_t length = limits.second; 189 for(std::vector<std::string>::const_iterator calo = calorimeters_.begin(); calo != calorimeters_.end(); ++calo) { 190 limits = addCalorimeter(top,calo->c_str(),radius,length,caloBinning_[*calo]); 191 if (withTowers) { 192 addCaloTowers(top,calo->c_str(),radius,length,caloBinning_[*calo]); 193 } 194 radius = limits.first; 195 length = limits.second; 196 } 197 for(std::vector<std::string>::const_iterator muon = muondets_.begin(); muon != muondets_.end(); ++muon) { 198 limits = addMuonDets(top, muon->c_str(), radius, length); 199 radius = limits.first; 200 length = limits.second; 197 201 } 198 202 // return the result … … 200 204 } 201 205 202 //typically from ChargedHadronTrackingEfficiency 203 void Delphes3DGeometry::addTracker(TGeoVolume *top) { 206 std::pair<Double_t, Double_t> Delphes3DGeometry::addTracker(TGeoVolume *top) { 204 207 // tracker: a cylinder with two cones substracted 205 208 TGeoCone* forwardCone = new TGeoCone("forwardTkAcceptance",(tk_length_/2.+0.05),0.,tk_radius_,(tk_length_)*2.*exp(-tk_etamax_)/(1-exp(-2.*tk_etamax_)),tk_radius_); … … 214 217 tracker->SetLineColor(kYellow); 215 218 top->AddNode(tracker,1); 216 } 217 218 void Delphes3DGeometry::addCalorimeters(TGeoVolume *top) { 219 return std::make_pair(tk_radius_,tk_length_); 220 } 221 222 std::pair<Double_t, Double_t> Delphes3DGeometry::addCalorimeter(TGeoVolume *top, const char* name, 223 Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning) { 224 // parameters derived from the inputs 225 Double_t calo_endcap_etamax = TMath::Max(fabs(caloBinning.begin()->first),fabs(caloBinning.rbegin()->first)); 226 Double_t calo_barrel_innerRadius = innerBarrelRadius+contingency_; 227 Double_t calo_barrel_length = innerBarrelLength + calo_barrel_thickness_; 228 Double_t calo_endcap_etamin = -log(innerBarrelRadius/(2*innerBarrelLength)); 229 Double_t calo_endcap_innerRadius1 = innerBarrelLength*2.*exp(-calo_endcap_etamax)/(1-exp(-2.*calo_endcap_etamax)); 230 Double_t calo_endcap_innerRadius2 = (innerBarrelLength+calo_endcap_thickness_)*2.*exp(-calo_endcap_etamax)/(1-exp(-2.*calo_endcap_etamax)); 231 Double_t calo_endcap_outerRadius1 = innerBarrelRadius; 232 Double_t calo_endcap_outerRadius2 = innerBarrelRadius+calo_barrel_thickness_; 233 Double_t calo_endcap_coneThickness = TMath::Min(calo_barrel_thickness_ * (1-exp(-2.*calo_endcap_etamin)) / (2.*exp(-calo_endcap_etamin)), calo_endcap_thickness_); 234 Double_t calo_endcap_diskThickness = TMath::Max(0.,calo_endcap_thickness_-calo_endcap_coneThickness); 235 219 236 // calorimeters: tube truncated in eta + cones 220 221 /*TGeoTube *calo_barrel_cylinder =*/ new TGeoTube("calo_barrel_cylinder",calo_barrel_innerRadius_,tk_radius_+calo_barrel_thickness_+contingency_,tk_length_+calo_barrel_thickness_); 222 /*TGeoCone *calo_endcap_cone =*/ new TGeoCone("calo_endcap_cone",calo_endcap_coneThickness_/2.,calo_endcap_innerRadius1_,calo_endcap_outerRadius1_,calo_endcap_innerRadius2_,calo_endcap_outerRadius2_); 223 /*TGeoTube *calo_endcap_disk =*/ new TGeoTube("calo_endcap_disk",calo_endcap_innerRadius2_,tk_radius_+calo_barrel_thickness_,calo_endcap_diskThickness_/2.); 224 TGeoTranslation *tr1 = new TGeoTranslation("tr1",0., 0., (calo_endcap_coneThickness_+calo_endcap_diskThickness_)/2.); 237 new TGeoTube(Form("%s_barrel_cylinder",name),calo_barrel_innerRadius,calo_barrel_innerRadius+calo_barrel_thickness_,calo_barrel_length); 238 new TGeoCone(Form("%s_endcap_cone",name),calo_endcap_coneThickness/2.,calo_endcap_innerRadius1,calo_endcap_outerRadius1,calo_endcap_innerRadius2,calo_endcap_outerRadius2); 239 new TGeoTube(Form("%s_endcap_disk",name),calo_endcap_innerRadius2,tk_radius_+calo_barrel_thickness_,calo_endcap_diskThickness/2.); 240 TGeoTranslation *tr1 = new TGeoTranslation(Form("%s_tr1",name),0., 0., (calo_endcap_coneThickness+calo_endcap_diskThickness)/2.); 225 241 tr1->RegisterYourself(); 226 TGeoCompositeShape *calo_endcap_cs = new TGeoCompositeShape( "calo_endcap_cs","calo_endcap_cone+calo_endcap_disk:tr1");227 TGeoTranslation *trc1 = new TGeoTranslation( "calo_endcap1_position",0.,0., tk_length_+calo_endcap_coneThickness_/2.);242 TGeoCompositeShape *calo_endcap_cs = new TGeoCompositeShape(Form("%s_endcap_cs",name),Form("%s_endcap_cone+%s_endcap_disk:%s_tr1",name,name,name)); 243 TGeoTranslation *trc1 = new TGeoTranslation(Form("%s_endcap1_position",name),0.,0., innerBarrelLength+calo_endcap_coneThickness/2.); 228 244 trc1->RegisterYourself(); 229 TGeoRotation *negz = new TGeoRotation( "negz",0,180,0);230 TGeoCombiTrans *trc2 = new TGeoCombiTrans( "calo_endcap2_position",0.,0.,-(tk_length_+calo_endcap_coneThickness_/2.),negz);245 TGeoRotation *negz = new TGeoRotation(Form("%s_negz",name),0,180,0); 246 TGeoCombiTrans *trc2 = new TGeoCombiTrans(Form("%s_endcap2_position",name),0.,0.,-(innerBarrelLength+calo_endcap_coneThickness/2.),negz); 231 247 trc2->RegisterYourself(); 232 TGeoTranslation *trc1c = new TGeoTranslation( "calo_endcap1_position_cont",0.,0., tk_length_+calo_endcap_coneThickness_/2.+contingency_);248 TGeoTranslation *trc1c = new TGeoTranslation(Form("%s_endcap1_position_cont",name),0.,0., innerBarrelLength+calo_endcap_coneThickness/2.+contingency_); 233 249 trc1c->RegisterYourself(); 234 TGeoCombiTrans *trc2c = new TGeoCombiTrans( "calo_endcap2_position_cont",0.,0.,-(tk_length_+calo_endcap_coneThickness_/2.)-contingency_,negz);250 TGeoCombiTrans *trc2c = new TGeoCombiTrans(Form("%s_endcap2_position_cont",name),0.,0.,-(innerBarrelLength+calo_endcap_coneThickness/2.)-contingency_,negz); 235 251 trc2c->RegisterYourself(); 236 TGeoVolume *calo_endcap = new TGeoVolume("calo_endcap",calo_endcap_cs,calomed_); 237 TGeoCompositeShape *calo_barrel_cs = new TGeoCompositeShape("calo_barrel_cs","calo_barrel_cylinder-calo_endcap_cs:calo_endcap1_position-calo_endcap_cs:calo_endcap2_position"); 238 TGeoVolume *calo_barrel = new TGeoVolume("calo_barrel",calo_barrel_cs,calomed_); 252 TGeoVolume *calo_endcap = new TGeoVolume(Form("%s_endcap",name),calo_endcap_cs,calomed_); 253 TGeoCompositeShape *calo_barrel_cs = new TGeoCompositeShape(Form("%s_barrel_cs",name), 254 Form("%s_barrel_cylinder-%s_endcap_cs:%s_endcap1_position-%s_endcap_cs:%s_endcap2_position",name,name,name,name,name)); 255 TGeoVolume *calo_barrel = new TGeoVolume(Form("%s_barrel",name),calo_barrel_cs,calomed_); 239 256 calo_endcap->SetLineColor(kViolet); 240 257 calo_endcap->SetFillColor(kViolet); … … 243 260 top->AddNode(calo_endcap,2,trc2c); 244 261 top->AddNode(calo_barrel,1); 245 } 246 247 void Delphes3DGeometry::addMuonDets(TGeoVolume *top) { 248 262 return std::make_pair(calo_barrel_innerRadius+calo_barrel_thickness_,innerBarrelLength+calo_endcap_thickness_+contingency_); 263 } 264 265 std::pair<Double_t, Double_t> Delphes3DGeometry::addMuonDets(TGeoVolume *top, const char* name, Double_t innerBarrelRadius, Double_t innerBarrelLength) { 249 266 // muon system: tube + disks 250 Double_t muonSystem_radius = tk_radius_+calo_barrel_thickness_+2*contingency_;251 Double_t muonSystem_length = tk_length_+TMath::Max(calo_endcap_coneThickness_,calo_endcap_thickness_)+2*contingency_;252 Double_t muonSystem_rmin = muonSystem_length*2.*exp(-muonSystem_etamax_ )/(1-exp(-2.*muonSystem_etamax_));253 TGeoVolume *muon_barrel = geom_->MakeTube( "muon_barrel",mudetmed_,muonSystem_radius,muonSystem_radius+muonSystem_thickn_,muonSystem_length);267 Double_t muonSystem_radius = innerBarrelRadius + contingency_; 268 Double_t muonSystem_length = innerBarrelLength + contingency_; 269 Double_t muonSystem_rmin = muonSystem_length*2.*exp(-muonSystem_etamax_[name])/(1-exp(-2.*muonSystem_etamax_[name])); 270 TGeoVolume *muon_barrel = geom_->MakeTube(Form("%s_barrel",name),mudetmed_,muonSystem_radius,muonSystem_radius+muonSystem_thickn_,muonSystem_length); 254 271 muon_barrel->SetLineColor(kBlue); 255 272 top->AddNode(muon_barrel,1); 256 TGeoVolume *muon_endcap = geom_->MakeTube( "muon_endcap",mudetmed_,muonSystem_rmin,muonSystem_radius+muonSystem_thickn_,muonSystem_thickn_/2.);273 TGeoVolume *muon_endcap = geom_->MakeTube(Form("%s_endcap",name),mudetmed_,muonSystem_rmin,muonSystem_radius+muonSystem_thickn_,muonSystem_thickn_/2.); 257 274 muon_endcap->SetLineColor(kBlue); 258 TGeoTranslation *trm1 = new TGeoTranslation( "muonEndcap1_position",0.,0.,muonSystem_length);275 TGeoTranslation *trm1 = new TGeoTranslation(Form("%sEndcap1_position",name),0.,0.,muonSystem_length); 259 276 trm1->RegisterYourself(); 260 TGeoTranslation *trm2 = new TGeoTranslation( "muonEndcap2_position",0.,0.,-muonSystem_length);277 TGeoTranslation *trm2 = new TGeoTranslation(Form("%sEndcap2_position",name),0.,0.,-muonSystem_length); 261 278 trm1->RegisterYourself(); 262 279 top->AddNode(muon_endcap,1,trm1); 263 280 top->AddNode(muon_endcap,1,trm2); 264 } 265 266 void Delphes3DGeometry::addCaloTowers(TGeoVolume *top) { 267 268 TGeoVolume* calo_endcap = top->GetNode("calo_endcap_1")->GetVolume(); 269 TGeoVolume* calo_barrel = top->GetNode("calo_barrel_1")->GetVolume(); 281 return std::make_pair(muonSystem_radius,muonSystem_length); 282 } 283 284 void Delphes3DGeometry::addCaloTowers(TGeoVolume *top, const char* name, 285 Double_t innerBarrelRadius, Double_t innerBarrelLength, set< pair<Double_t, Int_t> >& caloBinning) { 286 287 TGeoVolume* calo_endcap = top->GetNode(Form("%s_endcap_1",name))->GetVolume(); 288 TGeoVolume* calo_barrel = top->GetNode(Form("%s_barrel_1",name))->GetVolume(); 289 Double_t calo_endcap_etamin = -log(innerBarrelRadius/(2*innerBarrelLength)); 290 Double_t calo_endcap_coneThickness = TMath::Min(calo_barrel_thickness_ * (1-exp(-2.*calo_endcap_etamin)) / (2.*exp(-calo_endcap_etamin)), calo_endcap_thickness_); 270 291 271 292 // calo towers in the barrel 272 293 Double_t vertices[16] = {0.,0.,0.,0.,0.,0.,0.,0.}; // summit of the pyramid 273 Double_t R = tk_radius_ +calo_barrel_thickness_+2*contingency_; // radius of the muons system = height of the pyramid274 Int_t nEtaBins = caloBinning _.size();294 Double_t R = tk_radius_ + contingency_+(contingency_+calo_barrel_thickness_)*calorimeters_.size(); // radius of the muons system = height of the pyramid 295 Int_t nEtaBins = caloBinning.size(); 275 296 // this rotation is to make the tower point "up" 276 TGeoRotation* initTowerRot = new TGeoRotation( "initTowerRot",0.,90.,0.);277 TGeoCombiTrans* initTower = new TGeoCombiTrans( "initTower",0.,-R/2.,0.,initTowerRot);297 TGeoRotation* initTowerRot = new TGeoRotation(Form("%s_initTowerRot",name),0.,90.,0.); 298 TGeoCombiTrans* initTower = new TGeoCombiTrans(Form("%s_initTower",name),0.,-R/2.,0.,initTowerRot); 278 299 initTower->RegisterYourself(); 279 300 // eta bins... we build one pyramid per eta slice and then translate it nphi times. … … 284 305 Int_t etaslice = 0; 285 306 std::map<std::pair<int,int>, TGeoRotation*> phirotations; 286 for(set< pair<Double_t, Int_t> >::const_iterator bin=caloBinning _.begin(); bin!=caloBinning_.end();++bin) {287 if(abs(bin->first)>calo_endcap_etamin _) continue; // only in the barrel307 for(set< pair<Double_t, Int_t> >::const_iterator bin=caloBinning.begin(); bin!=caloBinning.end();++bin) { 308 if(abs(bin->first)>calo_endcap_etamin) continue; // only in the barrel 288 309 nphi[etaslice] = bin->second; 289 310 y[etaslice] = 0.5*R*(1-exp(-2*bin->first))/exp(-bin->first); … … 291 312 dx[etaslice] = R*tan(TMath::Pi()*phiRotationAngle/360.); 292 313 for(int phislice=0;phislice<nphi[etaslice];++phislice) { 293 phirotations[make_pair(etaslice,phislice)] = new TGeoRotation(Form(" phi%d_%d",etaslice,phislice),phiRotationAngle*phislice,0.,0.);314 phirotations[make_pair(etaslice,phislice)] = new TGeoRotation(Form("%s_phi%d_%d",name,etaslice,phislice),phiRotationAngle*phislice,0.,0.); 294 315 phirotations[make_pair(etaslice,phislice)]->RegisterYourself(); 295 316 } … … 302 323 vertices[12] = dx[i]; vertices[13] = y[i+1]; 303 324 vertices[14] = dx[i]; vertices[15] = y[i]; 304 /*TGeoArb8 *tower =*/ new TGeoArb8(Form("tower%d",i),R/2., vertices); // tower in the proper eta slice, at phi=0325 new TGeoArb8(Form("%s_tower%d",name,i),R/2., vertices); // tower in the proper eta slice, at phi=0 305 326 // intersection between the tower and the calo_barrel 306 TGeoCompositeShape *finaltower_cs = new TGeoCompositeShape(Form(" ftower%d_cs",i),Form("tower%d:initTower*calo_barrel_cs",i));307 TGeoVolume *finaltower = new TGeoVolume(Form(" ftower%d",i),finaltower_cs,calomed_);327 TGeoCompositeShape *finaltower_cs = new TGeoCompositeShape(Form("%s_ftower%d_cs",name,i),Form("%s_tower%d:%s_initTower*%s_barrel_cs",name,i,name,name)); 328 TGeoVolume *finaltower = new TGeoVolume(Form("%s_ftower%d",name,i),finaltower_cs,calomed_); 308 329 finaltower->SetLineColor(kRed); 309 330 for(int j=0;j<nphi[i];++j) { // loop on the phi slices … … 315 336 delete[] nphi; 316 337 //the towers in the forward region 317 R = tk_length_+c alo_endcap_thickness_+3*contingency_; // Z of the muons system = height of the pyramid318 nEtaBins = caloBinning _.size();319 // translation to bring the origin of the tower to (0,0,0) 320 TGeoTranslation* towerdz = new TGeoTranslation( "towerdz",0.,0.,R/2.-(tk_length_+calo_endcap_coneThickness_/2.));338 R = tk_length_+contingency_+(contingency_+calo_endcap_thickness_)*calorimeters_.size(); // Z of the muons system = height of the pyramid 339 nEtaBins = caloBinning.size(); 340 // translation to bring the origin of the tower to (0,0,0) (well, not really as the endcap is not yet in place) 341 TGeoTranslation* towerdz = new TGeoTranslation(Form("%s_towerdz",name),0.,0.,R/2.-(innerBarrelLength+calo_endcap_coneThickness/2.)); 321 342 towerdz->RegisterYourself(); 322 343 // eta bins... we build one pyramid per eta slice and then translate it nphi times. … … 325 346 etaslice = 0; 326 347 phirotations.clear(); 327 for(set< pair<Double_t, Int_t> >::const_iterator bin=caloBinning _.begin(); bin!=caloBinning_.end();++bin) {328 if(bin->first<calo_endcap_etamin _) continue; // only in the + endcap348 for(set< pair<Double_t, Int_t> >::const_iterator bin=caloBinning.begin(); bin!=caloBinning.end();++bin) { 349 if(bin->first<calo_endcap_etamin) continue; // only in the + endcap 329 350 r[etaslice] = R*2*exp(-bin->first)/(1-exp(-2*bin->first)); 330 351 nphi[etaslice] = bin->second; 331 352 Double_t phiRotationAngle = 360./nphi[etaslice]; 332 353 for(int phislice=0;phislice<nphi[etaslice];++phislice) { 333 phirotations[make_pair(etaslice,phislice)] = new TGeoRotation(Form(" forward_phi%d_%d",etaslice,phislice),phiRotationAngle*phislice,0.,0.);354 phirotations[make_pair(etaslice,phislice)] = new TGeoRotation(Form("%s_forward_phi%d_%d",name,etaslice,phislice),phiRotationAngle*phislice,0.,0.); 334 355 phirotations[make_pair(etaslice,phislice)]->RegisterYourself(); 335 356 } … … 342 363 vertices[12] = r[i]*sin(TMath::Pi()/20.); vertices[13] = r[i]*cos(TMath::Pi()/20.); 343 364 vertices[14] = r[i+1]*sin(TMath::Pi()/20.); vertices[15] = r[i+1]*cos(TMath::Pi()/20.); 344 /*TGeoArb8 *fwdtower =*/ new TGeoArb8(Form("fwdtower%d",i),R/2., vertices); // tower in the proper eta slice, at phi=0365 new TGeoArb8(Form("%sfwdtower%d",name,i),R/2., vertices); // tower in the proper eta slice, at phi=0 345 366 // intersection between the tower and the calo_endcap 346 TGeoCompositeShape *finalfwdtower_cs = new TGeoCompositeShape(Form(" ffwdtower%d_cs",i),Form("fwdtower%d:towerdz*calo_endcap_cs",i));347 TGeoVolume *finalfwdtower = new TGeoVolume(Form(" ffwdtower%d",i),finalfwdtower_cs,calomed_);367 TGeoCompositeShape *finalfwdtower_cs = new TGeoCompositeShape(Form("%sffwdtower%d_cs",name,i),Form("%sfwdtower%d:%s_towerdz*%s_endcap_cs",name,i,name,name)); 368 TGeoVolume *finalfwdtower = new TGeoVolume(Form("%sffwdtower%d",name,i),finalfwdtower_cs,calomed_); 348 369 finalfwdtower->SetLineColor(kViolet); 349 370 for(int j=0;j<nphi[i];++j) { // loop on the phi slices
Note:
See TracChangeset
for help on using the changeset viewer.