Skip to content
Snippets Groups Projects

CyDet tagger

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Matthias Dubouchet
    Edited
    IEnteredCyDetTagger.cpp 1.44 KiB
    bool IEnteredCyDetTagger::TagTrajectory(const IG4Trajectory& trajectory, ITrajectoryTagList& tags)const{
    
        // Check whether the particle entered CyDet at any point along the trajectory
        // Get points
        const std::vector<IG4TrajectoryPoint>& points = trajectory.GetTrajectoryPoints();
    
        IAnalysisUtilities::VolumeNames matchCDC;
        matchCDC.push_back("CylindricalDriftChamber");
    
        //COMETLog("Entering tag method");
        //COMETLog("" << points.size() << " points to be scanned");
    
        for (int i=0; i<points.size(); ++i) {
            TLorentzVector pos = points[i].GetPosition();
            //COMETLog("\tPosition: " << pos.X() << " " << pos.Y() << " " << pos.Z());
            if(IAnalysisUtilities::CheckVolumePath(pos.Vect(), &matchCDC)) {
                //COMETLog("Found a particle in CDC");
                int trackId = trajectory.GetTrackId();
                tags[trackId] += fEnteredCyDet;
                return true;
            } 
        }
    
        IAnalysisUtilities::VolumeNames matchCTH;
        matchCTH.push_back("CTH");
    
    
        for (int i=0; i<points.size(); ++i) {
            TLorentzVector pos = points[i].GetPosition();
            //COMETLog("\tPosition: " << pos.X() << " " << pos.Y() << " " << pos.Z());
            if(IAnalysisUtilities::CheckVolumePath(pos.Vect(), &matchCTH)) {
                //COMETLog("Found a particle in CTH");
                int trackId = trajectory.GetTrackId();
                tags[trackId] += fEnteredCyDet;
                return true;
            } 
        }
    
        return true;
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment