Linear Collider Forum



Home » Analysis and Reconstruction » Reconstruction » MC association
Re: MC association [message #482 is a reply to message #481] Mon, 22 May 2006 08:44 Go to previous messageGo to previous message
gaede
Messages: 231
Registered: January 2004
Location: DESY, Hamburg
Quote:

Among all these contributions how is it possible (if it is possible..) to establish the only MC particle responsible of the hit?


There can (and often will) be more than one particle contributing to one cell, i.e. one SimCalorimeterHit. If the collection parameter LCIO.CHBIT_PDG==0 then every MCContribution corresponds to one particle entering the calorimeter. To define the one that you want to use in your relation depends on your algorithm - you might simply take the particle with the largest contribution or you could keep the weights for your MC truth assignment.
If LCIO.CHBIT_PDG==1 then all simulator steps' contributions to the hit are stored, i.e. every shower particle is stored with it's PDG and energy - however the link getParticleCont() will still be to the MCParticle that entered the calorimeter - in this case you have to sum up all contributions for every particle to find the one that dominates...
The following code snippet should work in either case:

	  SimCalorimeterHit* sh =
	    dynamic_cast<SimCalorimeterHit*>( calVec->getElementAt(j) ) ; 

	  typedef std::map<MCParticle*,double>  MCPMap ; 
	  
	  MCPMap mcpMap ;
	  
	  for( int ii=0 ;ii< sh->getNMCContributions() ; ++ii){
	    mcpMap[  sh->getParticleCont(ii) ] += sh->getEnergyCont(ii) ;   
	  }
	  
	  double eMax(0.) ; 
	  MCParticle* mcp ;
	  
	  for( MCPMap::iterator it = mcpMap.begin() ;  it != mcpMap.end() ; ++it ){
	    
	    if( it->second > eMax ) {
	      mcp = it->first ;
	      eMax = it->second ;
	    }
	  } 
	  std::cout << " largest contribution " << eMax << " GeV from particle " 
		    << mcp << std::endl ;



Probably code like this should go into some sort of utility method in a future LCIO release ...

Frank.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Problem with Marlin 0.9.4
Next Topic:org.lcsim Tracking Examples
Goto Forum:
  


Current Time: Sat Feb 24 15:46:48 Pacific Standard Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software