ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitPhysics/Mods/src/PhotonTreeWriter.cc
(Generate patch)

Comparing UserCode/MitPhysics/Mods/src/PhotonTreeWriter.cc (file contents):
Revision 1.3 by bendavid, Fri Oct 7 09:56:36 2011 UTC vs.
Revision 1.4 by bendavid, Fri Nov 18 00:07:16 2011 UTC

# Line 232 | Line 232 | void PhotonTreeWriter::Process()
232        fDiphotonEvent->vtxX = phHard->PV()->X();
233        fDiphotonEvent->vtxY = phHard->PV()->Y();
234        fDiphotonEvent->vtxZ = phHard->PV()->Z();
235 +      fDiphotonEvent->vtxprob = phHard->VtxProb();
236      }
237      
238 <    Float_t _mass = -99.;
239 <    Float_t _masserr = -99.;
240 <    Float_t _masserrsmeared = -99.;
241 <    Float_t _ptgg = -99.;
242 <    Float_t _costheta = -99.;
238 >    Double_t _mass = -99.;
239 >    Double_t _masserr = -99.;
240 >    Double_t _masserrsmeared = -99.;
241 >    Double_t _masserrwrongvtx = -99.;
242 >    Double_t _masserrsmearedwrongvtx = -99.;
243 >    Double_t _ptgg = -99.;
244 >    Double_t _costheta = -99.;
245      PhotonTools::DiphotonR9EtaPtCats _evtcat = PhotonTools::kOctCat0;
246      if (phHard && phSoft) {
247        _mass = (phHard->Mom()+phSoft->Mom()).M();
# Line 247 | Line 250 | void PhotonTreeWriter::Process()
250        _ptgg = (phHard->Mom()+phSoft->Mom()).Pt();
251        _costheta = ThreeVector(phHard->Mom()).Unit().Dot(ThreeVector(phSoft->Mom()).Unit());
252        _evtcat = PhotonTools::DiphotonR9EtaPtCat(phHard,phSoft);
253 +      
254 +      const Double_t dz = 5.8;
255 +      Double_t deltamvtx = _mass*VertexTools::DeltaMassVtx(phHard->CaloPos().X(), phHard->CaloPos().Y(), phHard->CaloPos().Z(),
256 +            phSoft->CaloPos().X(), phSoft->CaloPos().Y(), phSoft->CaloPos().Z(),
257 +            dz);
258 +            
259 +      _masserrwrongvtx = TMath::Sqrt(_masserr*_masserr + deltamvtx*deltamvtx);
260 +      _masserrsmearedwrongvtx = TMath::Sqrt(_masserrsmeared*_masserrsmeared + deltamvtx*deltamvtx);
261 +            
262 +      
263      }
264        
265      
# Line 268 | Line 281 | void PhotonTreeWriter::Process()
281      fDiphotonEvent->mass = _mass;
282      fDiphotonEvent->masserr = _masserr;
283      fDiphotonEvent->masserrsmeared = _masserrsmeared;
284 +    fDiphotonEvent->masserrwrongvtx = _masserrwrongvtx;
285 +    fDiphotonEvent->masserrsmearedwrongvtx = _masserrsmearedwrongvtx;    
286      fDiphotonEvent->ptgg = _ptgg;
287      fDiphotonEvent->costheta =  _costheta;;
288      fDiphotonEvent->massele = _massele;
# Line 518 | Line 533 | void PhotonTreeWriterPhoton::SetVars(con
533          s = ele->SCluster();
534        }
535        const BasicCluster *b = s->Seed();
536 +      const BasicCluster *b2 = 0;
537 +      Double_t ebcmax = -99.;
538 +      for (UInt_t i=0; i<s->ClusterSize(); ++i) {
539 +        const BasicCluster *bc = s->Cluster(i);
540 +        if (bc->Energy() > ebcmax && bc !=b) {
541 +          b2 = bc;
542 +          ebcmax = bc->Energy();
543 +        }
544 +      }
545    
546   //       if (p && ele) {
547   //         printf("p    : r9 = %5f, e33 = %5f, e55 = %5f, hovere = %5f, sigieie = %5f\n",p->R9(),p->E33(),p->E55(),p->HadOverEm(),p->CoviEtaiEta());
# Line 594 | Line 618 | void PhotonTreeWriterPhoton::SetVars(con
618        e2x5bottom = b->E2x5Bottom();
619        e2x5left = b->E2x5Left();
620        e2x5right = b->E2x5Right();
621 <      eseed = b->Energy();
621 >      xseed = b->Pos().X();
622 >      yseed = b->Pos().Y();
623 >      zseed = b->Pos().Z();
624 >      
625 >      eseed = b->Energy();      
626 >      etaseed = b->Eta();
627 >      phiseed = b->Phi();
628 >      ietaseed = b->IEta();
629 >      iphiseed = b->IPhi();
630 >      ixseed = b->IX();
631 >      iyseed = b->IY();
632 >      etacryseed = b->EtaCry();
633 >      phicryseed = b->PhiCry();
634 >      xcryseed = b->XCry();
635 >      ycryseed = b->YCry();
636 >      thetaaxisseed = b->ThetaAxis();
637 >      phiaxisseed = b->PhiAxis();
638 >      
639 >      if (b2) {
640 >        ebc2 = b2->Energy();      
641 >        etabc2 = b2->Eta();
642 >        phibc2 = b2->Phi();
643 >        ietabc2 = b2->IEta();
644 >        iphibc2 = b2->IPhi();
645 >        ixbc2 = b2->IX();
646 >        iybc2 = b2->IY();
647 >        etacrybc2 = b2->EtaCry();
648 >        phicrybc2 = b2->PhiCry();
649 >        xcrybc2 = b2->XCry();
650 >        ycrybc2 = b2->YCry();
651 >        thetaaxisbc2 = b2->ThetaAxis();
652 >        phiaxisbc2 = b2->PhiAxis();        
653 >      }
654 >      else {
655 >        ebc2 = 0.;
656 >        etabc2 = 0.;
657 >        phibc2 = 0.;
658 >        ietabc2 = 0.;
659 >        iphibc2 = 0.;
660 >        ixbc2 = 0.;
661 >        iybc2 = 0.;
662 >        etacrybc2 = 0.;
663 >        phicrybc2 = 0.;
664 >        xcrybc2 = 0.;
665 >        ycrybc2 = 0.;
666 >        thetaaxisbc2 = 0.;
667 >        phiaxisbc2 = 0.;
668 >      }
669        
670        //initialize photon energy corrections if needed
671        /*if (!PhotonFix::initialised()) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines