Fork me on GitHub

Changeset 9330b7b in git


Ignore:
Timestamp:
Apr 3, 2017, 4:52:11 PM (7 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
accffb9
Parents:
781edf86
Message:

add RadiusMax and HalfLengthMax to ParticlePropagator

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/ParticlePropagator.cc

    r781edf86 r9330b7b  
    8686    return;
    8787  }
     88
     89  fRadiusMax = GetDouble("RadiusMax", fRadius);
     90  fHalfLengthMax = GetDouble("HalfLengthMax", fHalfLength);
    8891
    8992  // import array with output from filter/classifier module
     
    160163
    161164    // check that particle position is inside the cylinder
    162     if(TMath::Hypot(x, y) > fRadius || TMath::Abs(z) > fHalfLength)
     165    if(TMath::Hypot(x, y) > fRadiusMax || TMath::Abs(z) > fHalfLengthMax)
    163166    {
    164167      continue;
     
    177180    }
    178181
    179     if(TMath::Abs(q) < 1.0E-9 || TMath::Abs(fBz) < 1.0E-9)
     182    if(TMath::Hypot(x, y) > fRadius || TMath::Abs(z) > fHalfLength)
     183    {
     184      mother = candidate;
     185      candidate = static_cast<Candidate*>(candidate->Clone());
     186
     187      candidate->InitialPosition = candidatePosition;
     188      candidate->Position = candidatePosition;
     189      candidate->L = 0.0;
     190
     191      candidate->Momentum = candidateMomentum;
     192      candidate->AddCandidate(mother);
     193
     194      fOutputArray->Add(candidate);
     195    }
     196    else if(TMath::Abs(q) < 1.0E-9 || TMath::Abs(fBz) < 1.0E-9)
    180197    {
    181198      // solve pt2*t^2 + 2*(px*x + py*y)*t - (fRadius2 - x*x - y*y) = 0
     
    271288      // momentum, since the orignal particle momentum isn't known
    272289
    273       px = TMath::Sign(1.0,r) * pt * (-y_c / r_c);
    274       py = TMath::Sign(1.0,r) * pt * (x_c / r_c);
     290      px = TMath::Sign(1.0, r) * pt * (-y_c / r_c);
     291      py = TMath::Sign(1.0, r) * pt * (x_c / r_c);
    275292      etap = candidateMomentum.Eta();
    276293      phip = TMath::ATan2(py, px);
     
    280297      // calculate additional track parameters (correct for beamspot position)
    281298
    282       d0        = (  (x - bsx) * py - (y - bsy) * px) / pt;
     299      d0        = ((x - bsx) * py - (y - bsy) * px) / pt;
    283300      dz        = z - ((x - bsx) * px + (y - bsy) * py) / pt * (pz / pt);
    284301      p         = candidateMomentum.P();
    285       ctgTheta  = 1.0 / TMath::Tan (candidateMomentum.Theta ());
     302      ctgTheta  = 1.0 / TMath::Tan (candidateMomentum.Theta());
    286303
    287304
     
    301318      else
    302319      {
    303         asinrho = TMath::ASin( (fRadius*fRadius - r_c*r_c - r*r) / (2*TMath::Abs(r)*r_c)  );
     320        asinrho = TMath::ASin((fRadius*fRadius - r_c*r_c - r*r) / (2*TMath::Abs(r)*r_c));
    304321        delta = phi_0 - phi;
    305322        if(delta <-TMath::Pi()) delta += 2*TMath::Pi();
     
    356373        candidate->Momentum = candidateMomentum;
    357374
    358             candidate->L  = l*1.0E3;
    359 
    360             candidate->Xd = xd*1.0E3;
     375        candidate->L = l*1.0E3;
     376
     377        candidate->Xd = xd*1.0E3;
    361378        candidate->Yd = yd*1.0E3;
    362379        candidate->Zd = zd*1.0E3;
  • modules/ParticlePropagator.h

    r781edf86 r9330b7b  
    5050private:
    5151
    52   Double_t fRadius, fRadius2, fHalfLength;
     52  Double_t fRadius, fRadius2, fRadiusMax, fHalfLength, fHalfLengthMax;
    5353  Double_t fBz;
    5454
Note: See TracChangeset for help on using the changeset viewer.