User Tools

Site Tools


davinci:removetthits

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
davinci:removetthits [2011/02/10 10:23] decianmdavinci:removetthits [2011/02/11 22:28] (current) – [Idea] decianm
Line 2: Line 2:
 ===== Idea ===== ===== Idea =====
 Removing TT hits from long tracks can be a good check to see effects which are caused by the TT. Removing TT hits from long tracks can be a good check to see effects which are caused by the TT.
 +TO BE FINISHED WHEN IT WORKED AS I THOUGHT
 ===== How to ===== ===== How to =====
 Add the following two source files f.ex. to Tr/TrackTools. Add the following two source files f.ex. to Tr/TrackTools.
 +**TrackRemoveSTIDs.cpp**
 <code c> <code c>
 // Gaudi // Gaudi
 #include "GaudiKernel/AlgFactory.h" #include "GaudiKernel/AlgFactory.h"
- 
 #include <boost/foreach.hpp> #include <boost/foreach.hpp>
- 
 // track interfaces // track interfaces
 #include "Kernel/ISTChannelIDSelector.h" #include "Kernel/ISTChannelIDSelector.h"
 #include "Event/Track.h" #include "Event/Track.h"
- 
 #include "Kernel/LHCbID.h" #include "Kernel/LHCbID.h"
 #include "TrackRemoveSTIDs.h" #include "TrackRemoveSTIDs.h"
Line 38: Line 36:
 StatusCode TrackRemoveSTIDs::initialize() StatusCode TrackRemoveSTIDs::initialize()
 { {
-  // Initializes TsaInitialization at the begin of program execution. 
- 
   StatusCode sc = GaudiAlgorithm::initialize();   StatusCode sc = GaudiAlgorithm::initialize();
   if (sc.isFailure()){   if (sc.isFailure()){
      return Error("Failed to initialize");      return Error("Failed to initialize");
   }   }
- 
   // da selector   // da selector
   m_selector = tool<ISTChannelIDSelector>(m_selectorType, "RemovalSelector");   m_selector = tool<ISTChannelIDSelector>(m_selectorType, "RemovalSelector");
- 
   return StatusCode::SUCCESS;   return StatusCode::SUCCESS;
 } }
  
 StatusCode TrackRemoveSTIDs::execute(){ StatusCode TrackRemoveSTIDs::execute(){
- 
   Tracks* trackCont = get<Tracks>(m_inputLocation);   Tracks* trackCont = get<Tracks>(m_inputLocation);
   // loop and remove the hits   // loop and remove the hits
Line 58: Line 51:
     if ((*iterT)->type() == Track::Long) removeHits(*iterT);     if ((*iterT)->type() == Track::Long) removeHits(*iterT);
   } // iterT   } // iterT
- 
   return StatusCode::SUCCESS;   return StatusCode::SUCCESS;
 }; };
  
 void TrackRemoveSTIDs::removeHits(Track* aTrack) const{ void TrackRemoveSTIDs::removeHits(Track* aTrack) const{
- 
   // get the list of ones to remove....   // get the list of ones to remove....
   std::vector<LHCb::LHCbID> tmpCont;   std::vector<LHCb::LHCbID> tmpCont;
Line 70: Line 61:
     if (m_selector->select(id.stID()) == true) tmpCont.push_back(id);     if (m_selector->select(id.stID()) == true) tmpCont.push_back(id);
   }   }
- 
   BOOST_FOREACH(LHCb::LHCbID dead, tmpCont){    BOOST_FOREACH(LHCb::LHCbID dead, tmpCont){ 
     aTrack->removeFromLhcbIDs(dead);     aTrack->removeFromLhcbIDs(dead);
   }   }
 } }
 +</code> 
 +and **TrackRemoveSTIDs.h** 
 +<code c> 
 +// $Id:  $ 
 +#ifndef _TrackRemoveSTIDs_H_ 
 +#define _TrackRemoveSTIDs_H_ 
 +/** @class TrackRemoveSTIDs TrackRemoveSTIDs.h 
 + * 
 +  Clean out tracks with some criteria from the container 
 + * 
 +  @author M.Needham 
 +  @date   30/05/2006 
 + */ 
 +#include "GaudiAlg/GaudiAlgorithm.h" 
 +#include <string> 
 +#include <vector> 
 +class ISTChannelIDSelector; 
 +namespace LHCb{ 
 +  class Track; 
 +
 +class TrackRemoveSTIDs: public GaudiAlgorithm { 
 +public: 
 +  // Constructors and destructor 
 +  TrackRemoveSTIDs(const std::string& name, 
 +              ISvcLocator* pSvcLocator); 
 +  virtual ~TrackRemoveSTIDs(); 
 +  virtual StatusCode initialize(); 
 +  virtual StatusCode execute(); 
 +   
 +private: 
 +  std::string m_inputLocation; 
 +  ISTChannelIDSelector* m_selector; 
 +  std::string m_selectorType; 
 +  void removeHits(LHCb::Track* aTrack) const;  
 +}; 
 +#endif
 </code> </code>
  
 +In your options file, do something like: 
 +<code python> 
 +from Configurables import  TrackRemoveSTIDs 
 +hitRemover = TrackRemoveSTIDs('hitRemover'
 +selector = STSelectChannelIDByElement("ToolSvc.RemovalSelector"
 +selector.elementNames = ["TTa", "TTb"
 +selector.DetType = "TT" 
 +GaudiSequencer("myMC09SelJpsi2MuMuFilterSequence").Members += [myveloClusters, 
 +RawBankToSTClusterAlg("CreateTTClusters"), 
 +createITClusters, createITLiteClusters, hitRemover] 
 +</code>
davinci/removetthits.1297329799.txt.gz · Last modified: 2011/02/10 10:23 by decianm