ROOT logo
#include "hiterator.h"
#include "hruntimedb.h"
#include "hevent.h"
#include "hspectrometer.h"
#include "hdetector.h"
#include "hshowerdetector.h"
#include "hcategory.h"
#include "hlinearcatiter.h"
#include "hlocation.h"
#include "hshowerdigipar.h"
#include "hshowergeometry.h"
#include "hdebug.h"
#include "hades.h"
#include "showerdef.h"
#include "hshowerdigitizer.h"

//_HADES_CLASS_DESCRIPTION
/////////////////////////////////////////////////////////////////////
//
//  HShowerDigitizer digitizes data, puts output values into
//  HShowerRawMatr data category. The input data are read from the HGeantShower
//  category. The Shower digitization is split into several tasks as shown
//  in the flow diagram below.
//
//   ----------------------
//  |     HShowerUnpacker  |                                                                              //
//  |   (embedding mode)   | \                                                                            //
//  |                      |  \      ------------------                                                   //
//   ----------------------   |     |  HGeantShower    |                                                  //
//                            |      ------------------\                                                  //
//                            |                         \                                                 //
//                            |      ------------------  \------------->  ----------------------          //
//                            |     |  HGeantWire      |   <------------ |  HShowerHitDigitizer |         //
//                            |      ------------------\                  ----------------------          //
//                            |                         \                                                 //
//                 -------------     ------------------  \------------->  -----------------------         //
//             -- | HShowerRaw  |   |  HShowerRawMatr  |   <------------ |  HShowerPadDigitizer  |        //
//            |    -------------     ------------------\                 |( creates track objects|        //
//            |                                         \                |  for real tracks in   |        //
//   ----------------------          ------------------  \               |  embedding mode too)  |        //
//  |   HShowerCalibrater  |        |  HShowerTrack    |  \<------------  -----------------------         //
//  |   (embedding mode)   |         ------------------\   \                                              //
//   ----------------------                             \   \             -----------------------         //
//            |                      ------------------  \   ----------> |   HShowerCopy         |        //
//             -------------------> |  HShowerCal      |  \<------------ |(add charge of real hit|        //
//                                   ------------------\   \             | in embedding too )    |        //
//                                                      \   \             -----------------------         //
//                                   ------------------  ----\--------->  -----------------------         //
//                                  |  HShowerHitHdr   |   <--\--------- |  HShowerHitFinder     |        //
//                                   ------------------        \          -----------------------         //
//                                   ------------------         \        |                                //
//                                  |  HShowerPID      |   <-----\-------|                                //
//                                   ------------------           \      |                                //
//                                   ------------------            \     |                                //
//                                  |  HShowerHit      |   <--------\----|                                //
//                                   ------------------ <            \                                    //
//                                                       \            \                                   //
//                                                        \-------------> ------------------------        //
//                                                                       | HShowerHitTrackMatcher |       //
//                                                                        ------------------------        //
//
//
//  In the case of TRACK EMBEDDING of simulated tracks into
//  experimental data the real data are written by the HShowerUnpacker into
//  HShowerRaw category. The real hits are taken into
//  account by the digitizer (adding of charges). The embedding mode is recognized
//  automatically by analyzing the
//  gHades->getEmbeddingMode() flag.
//            Mode ==0 means no embedding
//                 ==1 realistic embedding (first real or sim hit makes the game)
//                 ==2 keep GEANT tracks   (as 1, but GEANT track numbers will always
//                     win against real data. besides the tracknumber the output will
//                     be the same as in 1)
//
/////////////////////////////////////////////////////////////////////

ClassImp(HShowerDigitizer)

    HShowerDigitizer::HShowerDigitizer(const Text_t *name,const Text_t *title) :
    HReconstructor(name,title)
{
    lNrEvent   = 0;
    pDigiPar  = NULL;
    pGeometry = NULL;
    fIter     = NULL;
}

HShowerDigitizer::HShowerDigitizer()
{
    lNrEvent   = 0;
    pDigiPar  = NULL;
    pGeometry = NULL;
    fIter     = NULL;
}


HShowerDigitizer::~HShowerDigitizer(void) {
    if (fIter) delete fIter;
}

Bool_t HShowerDigitizer::init() {
    fIter = (HIterator*)getInCat()->MakeIterator("native");

    return initParameters();
}

Bool_t HShowerDigitizer::initParameters() {
    HRuntimeDb* rtdb=gHades->getRuntimeDb();

    pGeometry = (HShowerGeometry*)rtdb-> getContainer("ShowerGeometry");
    if (!pGeometry) return kFALSE;

    pDigiPar = (HShowerDigiPar*)rtdb->getContainer("ShowerDigiPar");
    if (!pDigiPar) return kFALSE;

    return kTRUE;
}

HShowerDigitizer& HShowerDigitizer::operator=(HShowerDigitizer &c) {
    return c;
}

Int_t HShowerDigitizer::execute()
{
    TObject *pHit;

    lNrEvent++;
    fIter->Reset();
    Int_t n = 0;

    while((pHit = fIter->Next()))
    {
	digitize(pHit);
	n++;
    }

    sort();   // this is used to call the track sort() in pad digitizer

    return 0;
}


 hshowerdigitizer.cc:1
 hshowerdigitizer.cc:2
 hshowerdigitizer.cc:3
 hshowerdigitizer.cc:4
 hshowerdigitizer.cc:5
 hshowerdigitizer.cc:6
 hshowerdigitizer.cc:7
 hshowerdigitizer.cc:8
 hshowerdigitizer.cc:9
 hshowerdigitizer.cc:10
 hshowerdigitizer.cc:11
 hshowerdigitizer.cc:12
 hshowerdigitizer.cc:13
 hshowerdigitizer.cc:14
 hshowerdigitizer.cc:15
 hshowerdigitizer.cc:16
 hshowerdigitizer.cc:17
 hshowerdigitizer.cc:18
 hshowerdigitizer.cc:19
 hshowerdigitizer.cc:20
 hshowerdigitizer.cc:21
 hshowerdigitizer.cc:22
 hshowerdigitizer.cc:23
 hshowerdigitizer.cc:24
 hshowerdigitizer.cc:25
 hshowerdigitizer.cc:26
 hshowerdigitizer.cc:27
 hshowerdigitizer.cc:28
 hshowerdigitizer.cc:29
 hshowerdigitizer.cc:30
 hshowerdigitizer.cc:31
 hshowerdigitizer.cc:32
 hshowerdigitizer.cc:33
 hshowerdigitizer.cc:34
 hshowerdigitizer.cc:35
 hshowerdigitizer.cc:36
 hshowerdigitizer.cc:37
 hshowerdigitizer.cc:38
 hshowerdigitizer.cc:39
 hshowerdigitizer.cc:40
 hshowerdigitizer.cc:41
 hshowerdigitizer.cc:42
 hshowerdigitizer.cc:43
 hshowerdigitizer.cc:44
 hshowerdigitizer.cc:45
 hshowerdigitizer.cc:46
 hshowerdigitizer.cc:47
 hshowerdigitizer.cc:48
 hshowerdigitizer.cc:49
 hshowerdigitizer.cc:50
 hshowerdigitizer.cc:51
 hshowerdigitizer.cc:52
 hshowerdigitizer.cc:53
 hshowerdigitizer.cc:54
 hshowerdigitizer.cc:55
 hshowerdigitizer.cc:56
 hshowerdigitizer.cc:57
 hshowerdigitizer.cc:58
 hshowerdigitizer.cc:59
 hshowerdigitizer.cc:60
 hshowerdigitizer.cc:61
 hshowerdigitizer.cc:62
 hshowerdigitizer.cc:63
 hshowerdigitizer.cc:64
 hshowerdigitizer.cc:65
 hshowerdigitizer.cc:66
 hshowerdigitizer.cc:67
 hshowerdigitizer.cc:68
 hshowerdigitizer.cc:69
 hshowerdigitizer.cc:70
 hshowerdigitizer.cc:71
 hshowerdigitizer.cc:72
 hshowerdigitizer.cc:73
 hshowerdigitizer.cc:74
 hshowerdigitizer.cc:75
 hshowerdigitizer.cc:76
 hshowerdigitizer.cc:77
 hshowerdigitizer.cc:78
 hshowerdigitizer.cc:79
 hshowerdigitizer.cc:80
 hshowerdigitizer.cc:81
 hshowerdigitizer.cc:82
 hshowerdigitizer.cc:83
 hshowerdigitizer.cc:84
 hshowerdigitizer.cc:85
 hshowerdigitizer.cc:86
 hshowerdigitizer.cc:87
 hshowerdigitizer.cc:88
 hshowerdigitizer.cc:89
 hshowerdigitizer.cc:90
 hshowerdigitizer.cc:91
 hshowerdigitizer.cc:92
 hshowerdigitizer.cc:93
 hshowerdigitizer.cc:94
 hshowerdigitizer.cc:95
 hshowerdigitizer.cc:96
 hshowerdigitizer.cc:97
 hshowerdigitizer.cc:98
 hshowerdigitizer.cc:99
 hshowerdigitizer.cc:100
 hshowerdigitizer.cc:101
 hshowerdigitizer.cc:102
 hshowerdigitizer.cc:103
 hshowerdigitizer.cc:104
 hshowerdigitizer.cc:105
 hshowerdigitizer.cc:106
 hshowerdigitizer.cc:107
 hshowerdigitizer.cc:108
 hshowerdigitizer.cc:109
 hshowerdigitizer.cc:110
 hshowerdigitizer.cc:111
 hshowerdigitizer.cc:112
 hshowerdigitizer.cc:113
 hshowerdigitizer.cc:114
 hshowerdigitizer.cc:115
 hshowerdigitizer.cc:116
 hshowerdigitizer.cc:117
 hshowerdigitizer.cc:118
 hshowerdigitizer.cc:119
 hshowerdigitizer.cc:120
 hshowerdigitizer.cc:121
 hshowerdigitizer.cc:122
 hshowerdigitizer.cc:123
 hshowerdigitizer.cc:124
 hshowerdigitizer.cc:125
 hshowerdigitizer.cc:126
 hshowerdigitizer.cc:127
 hshowerdigitizer.cc:128
 hshowerdigitizer.cc:129
 hshowerdigitizer.cc:130
 hshowerdigitizer.cc:131
 hshowerdigitizer.cc:132
 hshowerdigitizer.cc:133
 hshowerdigitizer.cc:134
 hshowerdigitizer.cc:135
 hshowerdigitizer.cc:136
 hshowerdigitizer.cc:137
 hshowerdigitizer.cc:138
 hshowerdigitizer.cc:139
 hshowerdigitizer.cc:140
 hshowerdigitizer.cc:141
 hshowerdigitizer.cc:142