Linear Collider Forum



Home » Analysis and Reconstruction » Analysis Tools » how to get VtxBarrHits for a particle?
Re: how to get VtxBarrHits for a particle? [message #1219 is a reply to message #1211] Tue, 16 October 2007 04:53 Go to previous messageGo to previous message
nomerot
Messages: 13
Registered: December 2005
Location: University of Oxford
hi Dima, I think I am making progress - thanks for your help!

I have another question : what "layer" in SimTrackerHit.getLayer()) actually means? I found that hits with layer=0 for example are not always constrained to the first VD layer but are all over the place. What is the best way to understand to which subsystem/layer this hit belongs?

Here is wjat I do so far:

public class Analysis104 extends Driver {

private AIDA aida = AIDA.defaultInstance();
protected void process(EventHeader event)
{
List<MCParticle> particles = event.get(MCParticle.class,event.MC_PARTICLES);
aida.cloud1D("nTracks").fill(particles.size());
System.out.println("# of tracks = "+particles.size());

// Building the map :
HashMap<MCParticle,List<SimTrackerHit>> map = MCTrackFinder.getMCParticleToSimTrackerHitMap(event);

// looping over particles
for (MCParticle particle : particles)
{
// for pi+ only
if (particle.getPDGID() == 211) {
System.out.println("next pion");
// filling some histos
aida.cloud1D("energy").fill(particle.getEnergy());
aida.cloud1D("cosTheta").fill(VecOp.cosTheta(particle.getMomentum()));
aida.cloud1D("phi").fill(VecOp.phi(particle.getMomentum()));
// creating list of hits for each particle
List<SimTrackerHit> hitList = map.get(particle);
// looping over hits for this particle
for (SimTrackerHit trackerHit : hitList)
{
int cell = trackerHit.getCellID();
int layer = trackerHit.getLayer();
double[] pos = trackerHit.getPoint();
System.out.println("cell = "+cell+" layer = "+layer+" x = "+pos[0]+" y = "+pos[1]);
aida.cloud2D(" layer "+layer+" x vs y").fill(pos[0], pos[1]);
}
}
}
}
}

thanks, Andrei
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:question on The Students' Getting Started Guide
Next Topic:Neural Nets and lcsim.org
Goto Forum:
  


Current Time: Sun Jul 22 00:13:22 Pacific Daylight Time 2018
.:: Contact :: Home ::.

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