lcsim/src/org/lcsim/contrib/uiowa
diff -u -r1.52 -r1.53
--- ReclusterDTreeDriver.java 24 Sep 2008 00:11:53 -0000 1.52
+++ ReclusterDTreeDriver.java 28 Sep 2008 06:22:57 -0000 1.53
@@ -35,7 +35,7 @@
* in this package, which uses the implementation in
* org.lcsim.recon.cluster.directedtree developed by NIU).
*
- * @version $Id: ReclusterDTreeDriver.java,v 1.52 2008/09/24 00:11:53 mcharles Exp $
+ * @version $Id: ReclusterDTreeDriver.java,v 1.53 2008/09/28 06:22:57 tjkim Exp $
* @author Mat Charles <[log in to unmask]>
*/
@@ -47,7 +47,7 @@
protected boolean m_cheatOnHadronsMisidentifiedAsPhotons = false;
protected boolean m_cheatOnPhotons = false;
- protected boolean m_muonDebug = false;
+ protected boolean m_muonDebug = true;
protected boolean m_electronDebug = false;
protected boolean m_photonDebug = false;
protected boolean m_photonSplitDebug = false;
@@ -342,7 +342,7 @@
List<Cluster> photonLikePhotons = new Vector<Cluster>();
List<Cluster> electronClusters = new Vector<Cluster>();
List<Track> electronTracks = new Vector<Track>();
- List<Track> muonTracks = new Vector<Track>();
+ List<Track> muonTracks = event.get(Track.class, "MuonList");
photonHandling(photons, electronClusters, chargedHadronLikePhotons, modifiedPhotonClusters, photonLikePhotons, trackList, electronTracks, clustersMatchedToTracks, tracksMatchedToClusters);
// Resume track matching
@@ -512,10 +512,41 @@
event.put("ShowerFinderMips", preShowerMips);
event.getMetaData(preShowerMips).setTransient(true);
- //Muon finder
- scanForMuons(trackList, MapTrkToMIP, mipsMuon, muonTracks);
- event.put("MuonList", muonTracks);
- if(m_muonDebug) { aida.cloud1D("muon/muon size",100000).fill(muonTracks.size());}
+ if(m_muonDebug) {
+ aida.cloud1D("muon/muon size",100000).fill(muonTracks.size());
+ System.out.println("size of muon track= " + muonTracks.size());
+ for(Track tr : muonTracks){
+ List<MCParticle> m_truthList = getMCParticle(tr);
+ Hep3Vector track = (new BasicHep3Vector(tr.getMomentum()));
+ double p = track.magnitude();
+ double pT = Math.sqrt(track.x()*track.x() + track.y()*track.y());
+ double costheta = Math.abs(track.z()/p);
+
+ aida.cloud1D("muon/reconstructed muon").fill(p);
+ aida.cloud1D("muon/reconstructed pT muon").fill(pT);
+ aida.cloud1D("muon/reconstructed costheta").fill(costheta);
+
+ boolean goodmatch = true;
+ for(MCParticle part : m_truthList){
+ if(part.getPDGID() == 13 || part.getPDGID() == -13) {
+ goodmatch = true;
+ break;
+ }
+ goodmatch = false;
+ }
+ if(goodmatch) {
+ aida.cloud1D("muon/good matching muon").fill(p);
+ aida.cloud1D("muon/good matching pT muon").fill(pT);
+ aida.cloud1D("muon/good matching costheta").fill(costheta);
+ }
+ else {
+ aida.cloud1D("muon/not good matching muon").fill(p);
+ aida.cloud1D("muon/not good matching pT muon").fill(pT);
+ aida.cloud1D("muon/not good matching costheta").fill(costheta);
+ }
+ }
+ }
+
//Electron write out
event.put("ElectronList", electronTracks);
if(m_electronDebug) aida.cloud1D("electron size",100000).fill(electronTracks.size());
@@ -2128,6 +2159,7 @@
double bestmatch = -1;
for(Cluster mipMuon : mipsMuon){
if( mipMuon.getCalorimeterHits().size() > 1){
+
CalorimeterHit muonhit1 = mipMuon.getCalorimeterHits().get(mipMuon.getCalorimeterHits().size()-1);
CalorimeterHit muonhit0 = mipMuon.getCalorimeterHits().get(0);
Hep3Vector muonpos1 = new BasicHep3Vector(muonhit1.getPosition());
@@ -2164,13 +2196,13 @@
boolean match = bestmatch > 0.8;
for(MCParticle part : m_truthList){
- if(part.getPDGID() == 13 || part.getPDGID() == -13) {
- if(m_muonDebug){
- aida.cloud1D("muon/FastTrack muon").fill(p);
- aida.cloud1D("muon/FastTrack pT muon").fill(pT);
- aida.cloud1D("muon/FastTrack costheta").fill(costheta);
- }
+ if(part.getPDGID() == 13 || part.getPDGID() == -13) {
+ if(m_muonDebug){
+ aida.cloud1D("muon/FastTrack muon").fill(p);
+ aida.cloud1D("muon/FastTrack pT muon").fill(pT);
+ aida.cloud1D("muon/FastTrack costheta").fill(costheta);
}
+ }
}
if(match){