ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/VHbbAnalysisCode/src/MCInfoPlotSet.cpp
(Generate patch)

Comparing UserCode/grimes/VHbbAnalysisCode/src/MCInfoPlotSet.cpp (file contents):
Revision 1.1 by grimes, Tue Feb 14 01:43:15 2012 UTC vs.
Revision 1.3 by grimes, Wed Aug 15 22:37:47 2012 UTC

# Line 27 | Line 27 | void trkupgradeanalysis::MCInfoPlotSet::
27          pEventString_=new TH1F( "mcEventType", "Event type from MC", 10, 0.5, 10.5 );
28          pEventString_->SetDirectory(pDirectory);
29  
30 +        pNumberOfPrimaryVertices_=new TH1F( "numberOfPrimaryVertices", "Number of primary vertices", 71, -0.5, 70.5 );
31 +        pNumberOfPrimaryVertices_->SetDirectory(pDirectory);
32 +
33 +        pNumberOfBunchCrossings_=new TH1F( "numberOfBunchCrossings", "Number of bunch crossings", 71, -0.5, 70.5 );
34 +        pNumberOfInteractionsPerBunchCrossing_=new TH1F( "numberOfInteractionsPerBunchCrossing", "Number of interactions per bunch crossing", 71, -0.5, 70.5 );
35 +        pTotalInteractionsPerEvent_=new TH1F( "totalInteractionsPerEvent", "Total number of interactions per event", 71, -0.5, 70.5 );
36 +        pNumberOfBunchCrossings_->SetDirectory(pDirectory);
37 +        pNumberOfInteractionsPerBunchCrossing_->SetDirectory(pDirectory);
38 +        pTotalInteractionsPerEvent_->SetDirectory(pDirectory);
39 +
40          histogramHaveBeenBooked_=true;
41   }
42  
# Line 43 | Line 53 | void trkupgradeanalysis::MCInfoPlotSet::
53          {
54                  if( higgsInfo->dauid.size()==1 && std::abs(higgsInfo->dauid[0])==25 ) continue;
55  
56 +                std::cout << "H->(";
57 +                for( size_t index=0; index<higgsInfo->dauid.size() && index<higgsInfo->dauFourMomentum.size(); ++index )
58 +                {
59 +                        const int& daughterID=higgsInfo->dauid[index];
60 +                        const TLorentzVector& vector=higgsInfo->dauFourMomentum[index];
61 +                        if( index!=0 ) std::cout << ",";
62 +                        std::cout << daughterID << " [" << vector.Pt() << "]";
63 +                }
64 +                std::cout << ") ";
65 +        }
66 +        std::cout << "\n";
67 +
68 +        for( std::vector<VHbbEventAuxInfo::ParticleMCInfo>::const_iterator higgsInfo=higgsMCInfo.begin(); higgsInfo!=higgsMCInfo.end(); ++higgsInfo )
69 +        {
70 +                if( higgsInfo->dauid.size()==1 && std::abs(higgsInfo->dauid[0])==25 ) continue;
71 +
72                  eventStringStream << "H->(";
73                  for( std::vector<int>::const_iterator daughterID=higgsInfo->dauid.begin(); daughterID!=higgsInfo->dauid.end(); ++daughterID )
74                  {
# Line 88 | Line 114 | void trkupgradeanalysis::MCInfoPlotSet::
114          else binNumber=iBinNumber->second;
115  
116          pEventString_->Fill( binNumber );
117 +
118 +        pNumberOfPrimaryVertices_->Fill( eventAuxInfo.pvInfo.nVertices );
119 +
120 +        // Loop over the pile up data
121 +        unsigned int totalNumberOfInteractions=0;
122 +        unsigned int numberOfBunchCrossings=0;
123 +        for( std::map<int,unsigned int>::const_iterator iBXInteractionPair=eventAuxInfo.puInfo.pus.begin(); iBXInteractionPair!=eventAuxInfo.puInfo.pus.end(); ++iBXInteractionPair )
124 +        {
125 +                const unsigned int& numberOfInteractions=iBXInteractionPair->second;
126 +                totalNumberOfInteractions+=numberOfInteractions;
127 +                pNumberOfInteractionsPerBunchCrossing_->Fill( numberOfInteractions );
128 +                ++numberOfBunchCrossings;
129 +        }
130 +        pNumberOfBunchCrossings_->Fill( numberOfBunchCrossings );
131 +        pTotalInteractionsPerEvent_->Fill( totalNumberOfInteractions );
132 +
133   }
134  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines