Fork me on GitHub

Changeset 5496767 in git for modules


Ignore:
Timestamp:
Jun 17, 2016, 6:52:57 PM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
62d3bc5
Parents:
0f73bea
Message:

added array of constituents to vertices

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/PileUpMerger.cc

    r0f73bea r5496767  
    134134  dz0 = -1.0e6;
    135135  dt0 = -1.0e6;
    136  
     136
    137137  dt *= c_light*1.0E3; // necessary in order to make t in mm/c
    138138  dz *= 1.0E3; // necessary in order to make z in mm
    139  
     139
    140140  //cout<<dz<<","<<dt<<endl;
    141  
     141
    142142  vx = 0.0;
    143143  vy = 0.0;
    144  
     144
    145145  numberOfParticles = fInputArray->GetEntriesFast();
    146146  nch = 0;
    147   sumpt2 = 0.0; 
    148    
     147  sumpt2 = 0.0;
     148
    149149  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    150150  {
     
    154154    t = candidate->Position.T();
    155155    pt = candidate->Momentum.Pt();
    156        
     156
    157157    // take postion and time from first stable particle
    158158    if (dz0 < -999999.0)
     
    164164    candidate->Position.SetZ(z - dz0 + dz);
    165165    candidate->Position.SetT(t - dt0 + dt);
    166    
     166
    167167    fParticleOutputArray->Add(candidate);
    168  
     168
    169169    if(TMath::Abs(candidate->Charge) >  1.0E-9)
    170170    {
    171       nch++;   
     171      nch++;
    172172      sumpt2 += pt*pt;
    173     } 
     173    }
    174174  }
    175  
     175
    176176  if(numberOfParticles > 0)
    177177  {
     
    179179    vy /= sumpt2;
    180180  }
    181  
     181
    182182  nvtx++;
    183183  factory = GetFactory();
     
    188188  vertex->ClusterNDF = nch;
    189189  vertex->SumPT2 = sumpt2;
    190   vertex->GenSumPT2 = sumpt2; 
    191  
     190  vertex->GenSumPT2 = sumpt2;
     191
    192192  fVertexOutputArray->Add(vertex);
    193193
     
    204204    case 2:
    205205      numberOfEvents = fMeanPileUp;
    206       break;   
     206      break;
    207207    default:
    208208      numberOfEvents = gRandom->Poisson(fMeanPileUp);
     
    233233    vx = 0.0;
    234234    vy = 0.0;
    235    
     235
    236236    numberOfParticles = 0;
    237237    sumpt2 = 0.0;
    238    
     238
     239    vertex = factory->NewCandidate();
     240
    239241    while(fReader->ReadParticle(pid, x, y, z, t, px, py, pz, e))
    240242    {
     
    262264      vx += candidate->Position.X();
    263265      vy += candidate->Position.Y();
    264      
     266
    265267      ++numberOfParticles;
    266268      if(TMath::Abs(candidate->Charge) >  1.0E-9)
    267269      {
    268         nch++;   
     270        nch++;
    269271        sumpt2 += pt*pt;
    270       }
    271        
     272        vertex->AddCandidate(candidate);
     273
     274      }
     275
    272276      fParticleOutputArray->Add(candidate);
    273277    }
     
    278282      vy /= numberOfParticles;
    279283    }
    280    
     284
    281285    nvtx++;
    282286
    283     vertex = factory->NewCandidate();
    284287    vertex->Position.SetXYZT(vx, vy, dz, dt);
    285    
    286     vertex->ClusterIndex = nvtx; 
     288
     289    vertex->ClusterIndex = nvtx;
    287290    vertex->ClusterNDF = nch;
    288291    vertex->SumPT2 = sumpt2;
    289292    vertex->GenSumPT2 = sumpt2;
    290    
     293
    291294    vertex->IsPU = 1;
    292295
    293296    fVertexOutputArray->Add(vertex);
    294    
     297
    295298  }
    296299}
  • modules/TreeWriter.cc

    r0f73bea r5496767  
    240240{
    241241  TIter iterator(array);
    242   Candidate *candidate = 0;
     242  Candidate *candidate = 0, *constituent = 0;
    243243  Vertex *entry = 0;
    244244
    245245  const Double_t c_light = 2.99792458E8;
    246  
     246
    247247  Double_t x, y, z, t, xError, yError, zError, sigma, sumPT2, btvSumPT2, genDeltaZ, genSumPT2;
    248248  UInt_t index, ndf;
    249  
     249
    250250  array->Sort();
    251  
     251
    252252  // loop over all vertices
    253253  iterator.Reset();
    254254  while((candidate = static_cast<Candidate*>(iterator.Next())))
    255255  {
    256    
     256
    257257    index = candidate->ClusterIndex;
    258258    ndf = candidate->ClusterNDF;
     
    262262    genDeltaZ = candidate->GenDeltaZ;
    263263    genSumPT2 = candidate->GenSumPT2;
    264    
     264
    265265    x = candidate->Position.X();
    266266    y = candidate->Position.Y();
    267267    z = candidate->Position.Z();
    268268    t = candidate->Position.T()*1.0E-3/c_light;
    269  
     269
    270270    xError = candidate->PositionError.X ();
    271271    yError = candidate->PositionError.Y ();
     
    281281    entry->GenDeltaZ = genDeltaZ;
    282282    entry->GenSumPT2 = genSumPT2;
    283    
     283
    284284    entry->X = x;
    285285    entry->Y = y;
    286286    entry->Z = z;
    287287    entry->T = t;
    288    
     288
    289289    entry->ErrorX = xError;
    290290    entry->ErrorY = yError;
    291291    entry->ErrorZ = zError;
     292
     293    TIter itConstituents(candidate->GetCandidates());
     294
     295    while((constituent = static_cast<Candidate*>(itConstituents.Next())))
     296    {
     297      entry->Constituents.Add(constituent);
     298    }
     299
    292300  }
    293301}
     
    332340    entry->ZOuter = position.Z();
    333341    entry->TOuter = position.T()*1.0E-3/c_light;
    334  
     342
    335343    entry->L = candidate->L;
    336  
     344
    337345    entry->D0            = candidate->D0;
    338346    entry->ErrorD0       = candidate->ErrorD0;
     
    346354    entry->ErrorCtgTheta = candidate->ErrorCtgTheta;
    347355    entry->Phi           = candidate->Phi;
    348     entry->ErrorPhi      = candidate->ErrorPhi; 
    349    
     356    entry->ErrorPhi      = candidate->ErrorPhi;
     357
    350358    entry->Xd = candidate->Xd;
    351359    entry->Yd = candidate->Yd;
     
    361369
    362370    entry->Eta = eta;
    363    
     371
    364372    particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
    365373    const TLorentzVector &initialPosition = particle->Position;
Note: See TracChangeset for help on using the changeset viewer.