Changeset 5 in Idarraga for SLHCVP1TrackVis


Ignore:
Timestamp:
Nov 24, 2010, 6:15:51 PM (14 years ago)
Author:
idarraga
Message:
 
Location:
SLHCVP1TrackVis/SLHCVP1Systems/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • SLHCVP1TrackVis/SLHCVP1Systems/src/SLHCVP1TraceTracks.cxx

    r2 r5  
    2222
    2323void SLHCVP1TrackSystem::TraceTracks(const TrackCollection * trackColl, SoSeparator * root){
     24
     25        // A separator for the labels
     26        SoSeparator * tracksSep = new SoSeparator;
    2427
    2528        TrackCollection::const_iterator trackItr, trackItrEnd = trackColl->end();
     
    6568
    6669                sw->addChild(line);
    67                 root->addChild(sw);
     70                tracksSep->addChild(sw);
    6871
    6972                //Bookkeep which track this 3D object corresponds to (we will need this to display track info when the user clicks):
     
    7174
    7275                //To avoid GUI freeze-ups:
    73                 updateGUI();
     76                //updateGUI();
    7477        }
    7578
    76 
     79        root->addChild(tracksSep);
    7780}
  • SLHCVP1TrackVis/SLHCVP1Systems/src/SLHCVP1TraceTruth.cxx

    r2 r5  
    4545
    4646        // A separator for the labels
    47         SoGroup * textGroup = new SoGroup;
    48         textGroup->ref();
     47        SoSeparator * textGroup = new SoSeparator;
    4948
    5049        // Get the GenEvent
     
    118117
    119118                        // 2D text, added to a Separator.
    120 
    121119                        SoTranslation * trans = new SoTranslation;
    122120                        CalcTranslation(endx, endy, endz);
     
    132130                        textGroup->addChild(text);
    133131
    134                         //To avoid GUI freeze-ups:
    135                         updateGUI();
    136                         nParticles++;
    137 
    138132                        // Store this new position, is going to be the old one
    139133                        // in the next iteration
     
    141135                        m_translationArray[_TRANS_INFO_X1][_TRANS_ARR_Y] = endy;
    142136                        m_translationArray[_TRANS_INFO_X1][_TRANS_ARR_Z] = endz;
     137                        nParticles++;
     138
    143139                }
    144140
  • SLHCVP1TrackVis/SLHCVP1Systems/src/SLHCVP1TrackSystem.cxx

    r2 r5  
    2626#include "HepMC/GenVertex.h"
    2727
     28#include "InDetSimEvent/SiHitCollection.h"
    2829#include "GeneratorObjects/McEventCollection.h"
    2930
     
    3738        //declareProperty("McEventCollectionKey", m_McEventCollectionKey="TruthEvent");
    3839        m_McEventCollectionKey="TruthEvent";
     40        m_SiHitCollKey= "PixelHits";
     41        m_SiClusterContKey = "PixelClusters";
    3942
    4043        // Only for plotting purposes.  End point of non decaying particles.
     
    6972        const TrackCollection *trackColl;
    7073        std::string trackname="Tracks";
    71         StatusCode status1 = sg->retrieve(trackColl, trackname);
    72         if (status1 != StatusCode::SUCCESS || !trackColl) {
     74        StatusCode status = sg->retrieve(trackColl, trackname);
     75        if (status != StatusCode::SUCCESS || !trackColl) {
    7376                message("Error: Could not retrieve track collection (used key="+QString(trackname.c_str())+")");
    7477        }else{
     
    8083        //sg->dump(); <-- don't call StoreGate::dump() here, VP1 freaks out, why ?
    8184        const McEventCollection * McEventColl;
    82         StatusCode status2 = sg->retrieve(McEventColl, m_McEventCollectionKey);
    83         if (status2 != StatusCode::SUCCESS || !McEventColl) {
     85        status = sg->retrieve(McEventColl, m_McEventCollectionKey);
     86        if (status != StatusCode::SUCCESS || !McEventColl) {
    8487                message("Could not find the McEventCollection");
    8588        }else{
    8689                TraceTruth(McEventColl, root);
    8790        }
     91
     92        /////////////////////////////////////////////////////////////////////////
     93        // Pixels, hits and clusters
     94        const SiHitCollection * SiHitColl;
     95        const InDet::SiClusterContainer * SiClusterCont;
     96
     97        status = sg->retrieve(SiHitColl, m_SiHitCollKey);
     98        StatusCode status2 = sg->retrieve(SiClusterCont, m_SiClusterContKey);
     99
     100        if (status != StatusCode::SUCCESS || !SiHitColl || status2 != StatusCode::SUCCESS || !SiClusterCont) {
     101                message("Could not find the SiHitCollection or SiClusterContainer");
     102        }else{
     103                DrawPixels(SiHitColl, SiClusterCont, root);
     104        }
     105
     106        //To avoid GUI freeze-ups:
     107        updateGUI();
    88108
    89109        return;
     
    155175
    156176        switch(TMath::Abs(pdgid)) {
     177        case(0):
     178                string = "(*)";
     179                break;
    157180        case(11):
    158181                string = "e(11)";
     
    171194                break;
    172195        case(211):
    173                 string = "pi+/-";
     196                string = "pi+";
     197                break;
     198        case(-211):
     199                string = "pi-";
    174200                break;
    175201        default:
Note: See TracChangeset for help on using the changeset viewer.