• Options file Ana_CCProtonPi0.opts Improved
    • More Control for CCProtonPi0 Flow
  • Debugging Messages from older versions removed
  • New NTuple Data Added to track all of the CUTs
  • New Function: setVertexData()
  • Class: AngleScan
    • Styling Modified to match Package Styling
    • Comments Added
  • Class: ClusterVectorInfo
    • Styling Modified to match Package Styling
    • Comments Added
  • Prong Colors Added for Scanning Sessions
  • New Documentation: ProcessAna_Scripts.txt

Status Update: Fake Pi0 Reconstruction

  • First we suspected it is due to proton hits
  • I did some tests on Cluster History at different stages of reconstruction
    • Before Everything
    • Before Muon
    • Before Michel
    • Before Proton
    • Before Pi0 Reconstruction
    • etc…
  • Find out that Pi0 Reconstruction DOES NOT touch proton prongs.
    • This is good. We are not having extra hits from proton/pion hits
    • However, this means that our first assumption is wrong! There is some other problem!
  • Prof. Mann and I decided that the best way to figure out what is going on is a scanning session of two sample of events
    • Signal with FAILED Reconstruction
    • Background with SUCCESSFUL Reconstruction

Cluster History Test

Test 1: Proton Prong Cluster History

  • Checking Cluster History of a single prong
    • Before: Used
    • After: Used

Test 2: Cluster History in Different Stages

  • Got all clusters and checked their history before each stage
    • Example Result:
    • N(Unused) N(Used)
    • Before Reco 41 120
    • Before Muon 41 120
    • Before Michel 41 120
    • Before Proton 41 120
    • Before Pi0 41 120
    • After Reco 0 161
  • Findings
    • Prong Clusters are already USED
    • There are additional clusters which are unused are used in Pi0 Reconstruction
    • In 2 sample Michel Stage also changed cluster History – See full list: NClusters Sheet1


  • Modified for CCProtonPi0 v1_04 Output
  • All Histograms Types Changed
    • Float to Double
    • TH1F to TH1D
    • TH2F to TH2D
  • Cut Table Statistics
    • Cut_Other: Represents all other cuts which are not tracked by CCProtonPi0 Package
  • Stacked Histogram for Pi0 Invariant Mass


  • Revised Pi0 Reconstruction
    • Global Variables Used in all functions
    • Removed unused functions and variables
    • ConeBlobs()
      • Variable Naming Match
      • Return type changed: StatusCode to bool
        • Returns false if setPi0ParticleData() fails
      • ConeBlobs() main function that controls Pi0 Reconstruction.
        • If it fails, the reconstructEvent() for that event stops.
    • VtxBlob()
      • Return type changed: StatusCode to bool
        • Always returns true (return type reserved for future implementation)
    • processBlobs()
      • Removed unused variables
      • Return type changed: StatusCode to void
  • Options File Modifications
    • New Options files for DEBUG
    • Original options file set to INFO


  • correctProtonProngEnergy()
    • Fixed a bug causing P4(Proton) = (nan,nan,nan,nan)
    • returns bool if Energy Correction Fails
  • setProtonParticleData()
    • double vertexZ no longer input parameter
    • Using Global Variable m_PrimaryVertex

Bug: correctProtonProngEnergy()


  • For some events 4-Momentum is zero
  • two fail modes observed:
    1. kinked tracks – if kinked track has 0 energy
    2. If particle already has 0 energy


  1. kinked tracks
    • Currently correctProtonProngEnergy() returns the final tracks energy as prong energy
    • Total Energy should be used
    • Summing 4-Momentum for each track in a prong
  2. If particle already has 0 energy
    • Check Particle energy before correctProtonProngEnergy()
    • if(E == 0) proton_isRecoGood = -1
    • else proton_isRecoGood = 1
  3. correctProtonProngEnergy() returns bool
    • returns false incase function fails
    • in this case use default particle 4-Momentum


  • TG4Trajectory Map Removed
  • Muon Reconstruction
    • Using Global Variables
      • m_MuonTrack
      • m_MuonProng
      • m_MuonParticle
    • SetMuonParticleData() Improved
  • Proton Reconstruction
    • Fixed a bug causing empty NTuple Branches even with a successful proton reconstruction
    • Using Global Variables
      • m_ProtonProngs
      • m_ProtonParticles
    • Stop Algorithm if CreateTrackedParticles() fails
    • New Variable Cut_Particle_None
    • Removed Proton Score Cut
    • getProtonProng() Improved
    • SetProtonParticleData() Improved
    • Branches initialized to SENTINEL = -9.9
  • Global Variable: m_PrimaryVertex
    • Still need to pass the variable to CCPi0 Functions – Some of the functions outside the Global Scope
  • Found a new bug in correctProtonProngEnergy()
    • If the function changes proton energy, NTuple Branches for Momentum and Energy does not filled correctly
    • Will fix this with v1_03

Debugging for Proton Reconstruction

Problem and Reason

  • Although recontructEvent() returns with a successful proton reconstruction; in some cases the NTuple branches for proton are empty.
  • Possible Reason:
    • getProtonProng() and setProtonParticleData() functions are not correctly working!
  • Using Global Variables making sure that getProtonProng() and setProtonParticleData() functions access SAME proton prong information.
  • This fix will be included under v1_2

Test Details

Test 1:

  • Global Variable:
    • testDouble
  • Function Used:
    • getProtonProng()
  • Did not passed variables to function
  • Assigned Value:
    • Before = 1987
    • Inside = 1986
  • Observed Value:
    • Before Call = 1987
    • Inside, Before Assignment = 1987
    • Inside, After Assignment = 1986
    • After Call = 1986
  • Test Results:
    • Do not PASS Global Variables to the Functions

Test 2:

  • Class Private Member:
    • testDouble
  • Test Results:
    • DOES NOT Compile
    • const functions CANNOT modify member variables

Test 3:

  • Global Variable:
    • testDouble
  • Functions Used:
    • getProtonProng() and setProtonParticleData()
  • Did not passed variables to function
  • Assigned Values and Observed Values were matched
  • Test Results:
    • getProtonProng() and setProtonParticleData() can access and modify the testDouble

Test 4:

  • Global Variables:
    • Minerva::ProngVect m_protonProngs;
    • Minerva::ParticleVect m_protonParticles;
  • Function Used: getProtonProng()
    • Before Call, m_protonProngs.size() = 0
    • After Call, m_protonProngs.size() = 1
  • Did not passed variables to functions
  • Test Results:
    • getProtonProng() can access and modify m_protonProngs;

Test 5:

  • Global Variables:
    • Minerva::ProngVect m_protonProngs;
    • Minerva::ParticleVect m_protonParticles;
  • Function Used:
    • getProtonProng() and setProtonParticleData()
  • Did not passed variables to functions
  • Test Results:
    • getProtonProng() and setProtonParticleData() can access and modify m_protonProngs;
    • PROBLEM: Need to clear m_protonProngs vector before each iteration.

Test 6:

  • Global Variables:
    • Minerva::ProngVect m_protonProngs;
    • Minerva::ParticleVect m_protonParticles;
  • Function Used:
    • getProtonProng() and setProtonParticleData()
  • Did not passed variables to functions
  • Testing for actual data analysis
  • Test Results:
    • Successful! – Works as expected!


  • New Histograms for preFilter() Results
  • Pi0 invariant mass histogram moved under Pion Class
  • Studies integrated with package
    • Studies folder removed
  • Proton Reconstruction fails even foundProton triggerred as true.
    • I will investigate it on Monday


  • PreFilterPi0()
    • Getting Vertex as input
    • Return Value Changed: StatusCode -> bool
    • Debug Messages and Comments
    • New Variables:
      • Rejected Energy
      • Status
        • preFilter_Result     
        • 0 = Passes Filter     
        • 1 = Rejected by Target Filter     
        • 2 = Rejected by Max Other     
        • 3 = Rejected by Min Other
  • tagTruth()
  • Final State Particle Table as INFO
    • m_writeFSParticle_Table controls execution
  • Using reverse_iterator
  • setParticleData Functions
    • Return Value Changed: StatusCode -> bool


  • setPi0ParticleData() Function reorganized completely
    • Function Order:
      1. Calculations
      2. Branch Filling
    • Additional Comments Added
  • Unused Variables Removed and Variable Naming Style Improved
  • Version Tracking Started
    • CCProtonPi0 v1_00 is the stable version capable of reconstructing All Final State Particles
  • changelog.txt file included with the package under doc/ folder

All Crashing Problems fixed

  • m_PrimaryVertex Global Variable was NULL inside some functions
    • Now passing, vertex as a parameter to the functions
  • There is no Truth Match Info for Pi0 for now
    • If I have good results, I may try to add it next week for better quality analysis
  • Functions disabled due to same Global Variable Problem
    • OneParLineFitBlob
    • TwoParLineFitBlobVtxDistance

Job Submission

./ProcessAna.py –mc –playlist minerva1 –dst –usecat –ana_tool CCProtonPi0 –outdir /minerva/data/users/oaltinok/CCProtonPi0/MC/minerva1


















  • minerva1 playlist on data3 disk are removed. Running minerva13C for testing.
  • Fixed problems causing Job Submission crashes
  • Trung’s Truth Match disabled – DigitVectorTruthInfo
  • One and Two Parameter Fit functions disabled
  • Successful Muon, Proton, Pi0 Reconstruction after test submission (No Crashes)
  • Need a study to make sure Reconstruction is Correct!

Pi0 Reconstruction Integrated

  • Complete Pi0 Reconstruction duplicated from CCPi0
  • ConeBlobs() Function included
  • Global Variables are included as it is in CCPi0
  • Keeping all branches of CCPi0, most of them for debugging purposes and will be removed in future
  • requirements file modified for ROOT Libraries
    • CORRECT: macro_append ROOT_linkopts ” -lPhysics -lHist -lGeom -lEG -lGpad -lGraf -lMinuit2 “
    • WRONG: macro_append ROOT_linkopts “-L$(ROOTSYS)/lib -lPhysics -lHist -lGeom -lEG -lGpad -
  • lGraf -lMinuit2″
  • Additional Classes duplicated from CCPi0 Package
  • Successful Build but did not tested job submission

Job Submission PROBLEM:

  • ToolSvc ERROR Cannot create tool CCProtonPi0Ana (No factory found)
  • PhysicsEventAnalysisAlg FATAL PhysicsEventAnalysisAlg:: Exception throw: tool():: Could not re- trieve Tool ’CCProtonPi0Ana’ StatusCode=FAILURE
  • PhysicsEventAnalysisAlg ERROR Could not obtain analysis tool: CCProtonPi0Ana


  • Changed source file name as CCProtonPi0
    • CCProtonPi0Ana -> CCProtonPi0


  • tagTruth() Improved
    • Added gamma kinematics and trackID
    • proton, pi0 and gamma have parentID and vtx information in addition to their kinematics (4-Momentum)
  • VtxBlob() Function completely is added
    • Having problems during compile
  • requirement file modified
    • Included ROOT Libraries but causing problems while linking

CCProtonPi0 Package

  • CCDeltaPlus Package renamed as CCProtonPi0
    • Created new cmt package for CCProtonPi0
    • Removed all files under CCDeltaPlus
    • Sent an e-mail to Chris and Philip, they will add CCProtonPi0 to the MINERvA Framework – SystemTests Option Files modified
    • NTupleAnalysis Modified
    • Output Data Area Modified
    • Self Manuals Modified
    • Committed changes to GitHub