Changeset 6777565 in git
- Timestamp:
- Jan 26, 2020, 6:25:30 PM (5 years ago)
- Branches:
- Timing
- Children:
- fec809d
- Parents:
- 77249aa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cards/FCC/FCChh_PileUpVtx.tcl
r77249aa r6777565 256 256 add InputArray MuonMomentumSmearing/muons 257 257 258 set ActiveFraction 0.013 259 set ChargeCollectionEfficiency 0.75 260 261 # fixme: this number should probably be charge/energy dependent, or absolute number in MeV/cm? 262 set Resolution 0.15 263 264 # active material properties (cf. http://pdg.lbl.gov/2014/AtomicNuclearProperties/properties8.dat) 258 259 # absolute resolution per measurement (normalized in MeV/cm) 260 set Resolution 0.4 261 262 # fraction of measurements to ignore when computing truncated mean 263 set TruncatedMeanFraction 0.5 264 265 # detector properties (active fraction = nhits*thickness/L) 266 set Thickness 200E-6 267 set ActiveFraction 0.00133 268 269 # Silicon properties, for other materials: 270 # cf. http://pdg.lbl.gov/2014/AtomicNuclearProperties/properties8.dat 271 265 272 set Z 14. 266 273 set A 28.0855 -
modules/EnergyLoss.cc
r77249aa r6777565 17 17 */ 18 18 19 /** \class EnergyLoss 20 * 21 * This module computes the charged energy loss according to the active material properties. 22 * The energy loss is simulated with a Landau convoluted by a Gaussian. The active material 23 * is assumed to be uniformly distributed in the detector volume. The actual active volume 24 * get normalized by multiplying the path length by the parameter ActiveFraction. 25 * 26 * 27 * \author M. Selvaggi - CERN 28 * 29 */ 30 19 /** \class EnergyLoss 20 * 21 * This module computes the charged energy loss according to the active material properties. 22 * The energy loss is simulated with a Landau convoluted by a Gaussian. 23 * 24 * \author M. Selvaggi - CERN 25 * 26 */ 31 27 #include "modules/EnergyLoss.h" 32 28 … … 56 52 //------------------------------------------------------------------------------ 57 53 58 EnergyLoss::EnergyLoss() 54 EnergyLoss::EnergyLoss() 59 55 { 60 56 } … … 71 67 { 72 68 73 fActiveFraction = GetDouble("ActiveFraction", 0.013); // fraction of active material that measures the deposited charge 74 fChargeCollectionEfficiency = GetDouble("ChargeCollectionEfficiency", 0.75); // this number shifts Landau to the left 75 76 // fixme: this number should probably be charge/energy dependent 77 fResolution = GetDouble("Resolution", 0.15); // 0 - perfect Landau energy loss (0.15 gives good agreement with CMS pixel detector) 69 fActiveFraction = GetDouble("ActiveFraction", 0.002); // active fraction of the detector 70 fThickness = GetDouble("Thickness", 200E-6); // active detector thickness 71 fResolution = GetDouble("Resolution", 0.4); // 0 - perfect Landau energy loss (0.15 gives good agreement with CMS pixel detector) 72 fTruncatedMeanFraction = GetDouble("TruncatedMeanFraction", 0.5); // fraction of measurements to ignore when computing mean 78 73 79 74 // active material properties (cf. http://pdg.lbl.gov/2014/AtomicNuclearProperties/properties8.dat) 80 fZ = GetDouble("Z", 14.);81 fA = GetDouble("A", 28.0855); // in g/mol82 f rho= GetDouble("rho", 2.329); // in g/cm383 f a = GetDouble("a", 0.1492);84 f m= GetDouble("m", 3.2546);85 f x0= GetDouble("x0", 0.2015);86 f x1= GetDouble("x1", 2.8716);87 fI = GetDouble("I", 173.0); // mean excitation potential in (eV)88 f c0= GetDouble("c0", 4.4355);75 fZ = GetDouble("Z", 14.); 76 fA = GetDouble("A", 28.0855); // in g/mol 77 fRho = GetDouble("rho", 2.329); // in g/cm3 78 fAa = GetDouble("a", 0.1492); 79 fM = GetDouble("m", 3.2546); 80 fX0 = GetDouble("x0", 0.2015); 81 fX1 = GetDouble("x1", 2.8716); 82 fI = GetDouble("I", 173.0); // mean excitation potential in (eV) 83 fX0 = GetDouble("c0", 4.4355); 89 84 90 85 // import arrays with output from other modules … … 125 120 void EnergyLoss::Process() 126 121 { 127 Candidate *candidate, *particle , *particleTest;122 Candidate *candidate, *particle; 128 123 vector<TIterator *>::iterator itInputList; 129 124 TIterator *iterator; 130 TObjArray *array; 131 132 Double_t beta, gamma, charge, x; 133 Double_t kappa, chi, me, I, Wmax, delta, avdE, dP, dx, dE, dEdx; 134 135 //cout<<"---------------- new event -------------------"<<endl; 125 126 Double_t beta, gamma, charge; 127 Double_t kappa, chi, me, I, Wmax, delta, avdE, dP, dx, L, dE, dEdx, res; 128 Double_t eloss_truncmean; 129 130 Int_t nhits; 131 vector<Double_t> elosses; 132 133 cout<<"---------------- new event -------------------"<<endl; 136 134 137 135 … … 145 143 while((candidate = static_cast<Candidate *>(iterator->Next()))) 146 144 { 147 //cout<<" ---------------- new candidate -------------------"<<endl;145 cout<<" ---------------- new candidate -------------------"<<endl; 148 146 const TLorentzVector &candidateMomentum = candidate->Momentum; 149 147 150 beta = candidateMomentum.Beta(); 151 gamma = candidateMomentum.Gamma(); 152 148 beta = candidateMomentum.Beta(); 149 gamma = candidateMomentum.Gamma(); 153 150 charge = TMath::Abs(candidate->Charge); 154 151 155 152 // length of the track normalized by the fraction of active material and the charge collection efficiency in the tracker (in cm) 156 dx = candidate->L * fActiveFraction * 0.1; 157 x = dx * fChargeCollectionEfficiency; 158 159 kappa = 2*0.1535*TMath::Abs(charge)*TMath::Abs(charge)*fZ*frho*x/(fA*beta*beta); //energy loss in MeV 153 //dx = candidate->L * fActiveFraction * 0.1; 154 // amount of material in one sensor (converted in cm) 155 dx = fThickness * 100.; 156 // path length in cm 157 L = candidate->L * 0.1; 158 159 160 // compute number of hits as path length over active length 161 nhits = Int_t(L*fActiveFraction/dx); 162 163 //cout<<L<<","<<fActiveFraction<<","<<dx<<","<<nhits<<endl; 164 165 kappa = 2*0.1535*TMath::Abs(charge)*TMath::Abs(charge)*fZ*fRho*dx/(fA*beta*beta); //energy loss in MeV 160 166 161 167 chi = 0.5*kappa; 162 me = 0.510998; // electron mass in MeV, need 168 me = 0.510998; // electron mass in MeV, need 163 169 I = fI*1e-6; // convert I in MeV 164 170 … … 166 172 Wmax = 2*me*beta*beta*gamma*gamma; // this is not valid for electrons 167 173 168 delta = Deltaf(f c0, fa, fm, fx0, fx1, beta, gamma);174 delta = Deltaf(fC0, fAa, fM, fX0, fX1, beta, gamma); 169 175 170 176 // Bethe-Bloch energy loss in MeV (not used here) 171 177 avdE = kappa*( TMath::Log(Wmax/I) - beta*beta - delta/2); 172 178 173 // most probable energy (MPV) loss for Landau 179 // most probable energy (MPV) loss for Landau in a single layer 174 180 dP = chi*( TMath::Log(Wmax/I) + TMath::Log(chi/I) + 0.2 - beta*beta - delta); 175 181 176 //cout<<"x: "<<x<<", Beta: "<< beta<<", Gamma: "<<gamma <<", Charge: "<<charge<<endl;177 182 if (candidateMomentum.Pt() > 5) { 183 cout<<"Nhits: "<<nhits<<", dx: "<<dx<<", Charge: "<<charge<<", Beta: "<< beta<<", Gamma: "<<gamma<<", PT: "<<candidateMomentum.Pt()<<endl; 178 184 //cout<<x<<","<<kappa<<endl; 179 //cout<<" Wmax: "<<Wmax<<", Chi: "<<chi<<", delta: "<<delta<<", DeDx: "<<avdE<<", DeltaP: "<<dP<<endl; 180 181 // compute total energy loss in MeV predicted by a Landau 182 dE = gRandom->Landau(dP,chi); // this is the total energy loss in MeV predicted by a Landau 183 184 // apply additionnal gaussian smearing to simulate finite resolution in charge measurement 185 dE = gRandom->Gaus(dE,fResolution*dP); 186 187 dEdx = dx > 0 ? dE/dx : -1. ; 185 cout<<" Wmax: "<<Wmax<<", Chi: "<<chi<<", delta: "<<delta<<", DeDx: "<<avdE<<", DeltaP: "<<dP<<endl; 186 } 187 188 // simulate Nhits energy loss measurements 189 elosses.clear(); 190 for (Int_t j=0; j<nhits; j++){ 191 // compute total energy loss in MeV predicted by a Landau 192 dE = gRandom->Landau(dP,chi); // this is the total energy loss in MeV predicted by a Landau 193 194 // convert resolution given in Mev/cm into absolute for this sensor 195 res = fResolution*dx; 196 197 // apply additionnal gaussian smearing 198 dE = gRandom->Gaus(dE,res); 199 elosses.push_back(dE); 200 } 201 202 sort (elosses.begin(), elosses.end()); 203 eloss_truncmean = TruncatedMean(elosses, fTruncatedMeanFraction); 204 205 206 dEdx = dx > 0 ? eloss_truncmean/dx : -1. ; 188 207 189 208 // store computed dEdx in MeV/cm 190 candidate->DeDx = dEdx; 191 209 candidate->DeDx = dEdx; 210 192 211 // add dedx also in Muons in electrons classes in treeWriter 193 212 // fix electrons here 194 213 // think whether any relevance for hits 195 214 196 215 197 216 //cout<<" eloss: "<<dE<<", dx: "<<dx<<", dEdx: "<<dEdx<<endl; 198 217 } … … 201 220 } 202 221 203 204 222 //------------------------------------------------------------------------------ 205 223 … … 209 227 Double_t x= TMath::Log10(beta*gamma); 210 228 Double_t delta = 0.; 211 229 212 230 //cout<<x<<","<<x0<<","<<x1<<","<<endl; 213 231 214 232 if (x < x0) 215 233 delta = 0.; … … 218 236 if (x> x1) 219 237 delta = 4.6052*x - c0; 220 238 221 239 return delta; 222 240 } 241 242 //------------------------------------------------------------------------------ 243 Double_t EnergyLoss::TruncatedMean(std::vector<Double_t> elosses, Double_t truncFrac) 244 { 245 Int_t new_size = Int_t( elosses.size() * (1 - truncFrac)); 246 247 // remove outliers and re-compute mean 248 elosses.resize(new_size); 249 return accumulate( elosses.begin(), elosses.end(), 0.0)/elosses.size(); 250 } -
modules/EnergyLoss.h
r77249aa r6777565 22 22 /** \class EnergyLoss 23 23 * 24 * Subtract pile-up contribution from tracks. 24 * This module computes the charged energy loss according to the active material properties. 25 * The energy loss is simulated with a Landau convoluted by a Gaussian. 25 26 * 26 * \author P. Demin - UCL, Louvain-la-Neuve27 * \author M. Selvaggi - CERN 27 28 * 28 29 */ … … 47 48 48 49 private: 49 Double_t fActiveFraction; 50 Double_t fChargeCollectionEfficiency; 51 Double_t fResolution; 50 51 Double_t fActiveFraction; 52 Double_t fThickness; 53 54 Double_t fResolution; 55 Double_t fTruncatedMeanFraction; 52 56 53 57 // material parameters 54 Double_t fZ; 55 Double_t fA; 56 Double_t f rho;58 Double_t fZ; 59 Double_t fA; 60 Double_t fRho; 57 61 58 Double_t f a;59 Double_t f m;60 Double_t f x0;61 Double_t f x1;62 Double_t fI; 63 Double_t f c0;62 Double_t fAa; 63 Double_t fM; 64 Double_t fX0; 65 Double_t fX1; 66 Double_t fI; 67 Double_t fC0; 64 68 65 69 // this function computes corrections due to polarisation of the material 66 70 Double_t Deltaf(Double_t c0, Double_t a, Double_t m, Double_t x0, Double_t x1, Double_t beta, Double_t gamma); 71 72 // this function computes truncated of dEdx measurements 73 Double_t TruncatedMean(std::vector<Double_t> elosses, Double_t truncFrac); 67 74 68 75 std::vector<TIterator *> fInputList; //!
Note:
See TracChangeset
for help on using the changeset viewer.