| 1 | <!-- ******************************************************** -->
|
|---|
| 2 | <!-- -->
|
|---|
| 3 | <!-- [History] -->
|
|---|
| 4 | <!-- Converted to DocBook: Katsuya Amako, Aug-2006 -->
|
|---|
| 5 | <!-- Changed by: Katsuya Amako, 21-Sep-1998 -->
|
|---|
| 6 | <!-- Changed by: Dennis Wright, 27-Nov-2001 -->
|
|---|
| 7 | <!-- Proof read by: Joe Chuma, 30-Jun-1999 -->
|
|---|
| 8 | <!-- -->
|
|---|
| 9 | <!-- ******************************************************** -->
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | <!-- ******************* Section (Level#1) ****************** -->
|
|---|
| 13 | <sect1 id="sect.Digi">
|
|---|
| 14 | <title>
|
|---|
| 15 | Digitization
|
|---|
| 16 | </title>
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 20 | <sect2 id="sect.Digi.Digi">
|
|---|
| 21 | <title>
|
|---|
| 22 | Digi
|
|---|
| 23 | </title>
|
|---|
| 24 |
|
|---|
| 25 | <para>
|
|---|
| 26 | A hit is created by a sensitive detector when a step goes through
|
|---|
| 27 | it. Thus, the sensitive detector is associated to the corresponding
|
|---|
| 28 | <emphasis>G4LogicalVolume</emphasis> object(s). On the other hand, a digit is
|
|---|
| 29 | created using information of hits and/or other digits by a
|
|---|
| 30 | digitizer module. The digitizer module is not associated with any
|
|---|
| 31 | volume, and you have to implicitly invoke the <literal>Digitize()</literal>
|
|---|
| 32 | method of your concrete <emphasis>G4VDigitizerModule</emphasis> class.
|
|---|
| 33 | </para>
|
|---|
| 34 |
|
|---|
| 35 | <para>
|
|---|
| 36 | Typical usages of digitizer module include:
|
|---|
| 37 |
|
|---|
| 38 | <itemizedlist spacing="compact">
|
|---|
| 39 | <listitem><para>
|
|---|
| 40 | simulate ADC and/or TDC
|
|---|
| 41 | </para></listitem>
|
|---|
| 42 | <listitem><para>
|
|---|
| 43 | simulate readout scheme
|
|---|
| 44 | </para></listitem>
|
|---|
| 45 | <listitem><para>
|
|---|
| 46 | generate raw data
|
|---|
| 47 | </para></listitem>
|
|---|
| 48 | <listitem><para>
|
|---|
| 49 | simulate trigger logics
|
|---|
| 50 | </para></listitem>
|
|---|
| 51 | <listitem><para>
|
|---|
| 52 | simulate pile up
|
|---|
| 53 | </para></listitem>
|
|---|
| 54 | </itemizedlist>
|
|---|
| 55 | </para>
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | <!-- ******* Bridgehead ******* -->
|
|---|
| 59 | <bridgehead renderas='sect4'>
|
|---|
| 60 | G4VDigi
|
|---|
| 61 | </bridgehead>
|
|---|
| 62 |
|
|---|
| 63 | <para>
|
|---|
| 64 | <emphasis>G4VDigi</emphasis> is an abstract base class which represents a
|
|---|
| 65 | digit. You have to inherit this base class and derive your own
|
|---|
| 66 | concrete digit class(es). The member data of your concrete digit
|
|---|
| 67 | class should be defined by yourself. <emphasis>G4VDigi</emphasis> has two virtual
|
|---|
| 68 | methods, <literal>Draw()</literal> and <literal>Print()</literal>.
|
|---|
| 69 | </para>
|
|---|
| 70 |
|
|---|
| 71 | <!-- ******* Bridgehead ******* -->
|
|---|
| 72 | <bridgehead renderas='sect4'>
|
|---|
| 73 | G4TDigiCollection
|
|---|
| 74 | </bridgehead>
|
|---|
| 75 |
|
|---|
| 76 | <para>
|
|---|
| 77 | <emphasis>G4TDigiCollection</emphasis> is a template class for digits
|
|---|
| 78 | collections, which is derived from the abstract base class
|
|---|
| 79 | <emphasis>G4VDigiCollection</emphasis>. <emphasis>G4Event</emphasis> has a
|
|---|
| 80 | <emphasis>G4DCofThisEvent</emphasis> object, which is a container class of
|
|---|
| 81 | collections of digits. The usages of <emphasis>G4VDigi</emphasis> and
|
|---|
| 82 | <emphasis>G4TDigiCollection</emphasis> are almost the same as <emphasis>G4VHit</emphasis> and
|
|---|
| 83 | <emphasis>G4THitsCollection</emphasis>, respectively, explained in the previous
|
|---|
| 84 | section.
|
|---|
| 85 | </para>
|
|---|
| 86 |
|
|---|
| 87 | </sect2>
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 | <!-- ******************* Section (Level#2) ****************** -->
|
|---|
| 91 | <sect2 id="sect.Digi.DigMod">
|
|---|
| 92 | <title>
|
|---|
| 93 | Digitizer module
|
|---|
| 94 | </title>
|
|---|
| 95 |
|
|---|
| 96 | <!-- ******* Bridgehead ******* -->
|
|---|
| 97 | <bridgehead renderas='sect4'>
|
|---|
| 98 | G4VDigitizerModule
|
|---|
| 99 | </bridgehead>
|
|---|
| 100 |
|
|---|
| 101 | <para>
|
|---|
| 102 | <emphasis>G4VDigitizerModule</emphasis> is an abstract base class which
|
|---|
| 103 | represents a digitizer module. It has a pure virtual method,
|
|---|
| 104 | <literal>Digitize()</literal>. A concrete digitizer module must have an
|
|---|
| 105 | implementation of this virtual method. The Geant4 kernel classes do
|
|---|
| 106 | not have a ``built-in'' invocation to the <literal>Digitize()</literal>
|
|---|
| 107 | method. You have to implement your code to invoke this method of
|
|---|
| 108 | your digitizer module.
|
|---|
| 109 | </para>
|
|---|
| 110 |
|
|---|
| 111 | <para>
|
|---|
| 112 | In the <literal>Digitize()</literal> method, you construct your
|
|---|
| 113 | <emphasis>G4VDigi</emphasis> concrete class objects and store them to your
|
|---|
| 114 | <emphasis>G4TDigiCollection</emphasis> concrete class object(s). Your
|
|---|
| 115 | collection(s) should be associated with the <emphasis>G4DCofThisEvent</emphasis>
|
|---|
| 116 | object.
|
|---|
| 117 | </para>
|
|---|
| 118 |
|
|---|
| 119 | <!-- ******* Bridgehead ******* -->
|
|---|
| 120 | <bridgehead renderas='sect4'>
|
|---|
| 121 | G4DigiManager
|
|---|
| 122 | </bridgehead>
|
|---|
| 123 |
|
|---|
| 124 | <para>
|
|---|
| 125 | <emphasis>G4DigiManager</emphasis> is the singleton manager class of the
|
|---|
| 126 | digitizer modules. All of your concrete digitizer modules should be
|
|---|
| 127 | registered to <emphasis>G4DigiManager</emphasis> with their unique names.
|
|---|
| 128 |
|
|---|
| 129 | <informalexample>
|
|---|
| 130 | <programlisting>
|
|---|
| 131 | G4DigiManager * fDM = G4DigiManager::GetDMpointer();
|
|---|
| 132 | MyDigitizer * myDM = new MyDigitizer( "/myDet/myCal/myEMdigiMod" );
|
|---|
| 133 | fDM->AddNewModule(myDM);
|
|---|
| 134 | </programlisting>
|
|---|
| 135 | </informalexample>
|
|---|
| 136 | </para>
|
|---|
| 137 |
|
|---|
| 138 | <para>
|
|---|
| 139 | Your concrete digitizer module can be accessed from your code using
|
|---|
| 140 | the unique module name.
|
|---|
| 141 |
|
|---|
| 142 | <informalexample>
|
|---|
| 143 | <programlisting>
|
|---|
| 144 | G4DigiManager * fDM = G4DigiManager::GetDMpointer();
|
|---|
| 145 | MyDigitizer * myDM = fDM->FindDigitizerModule( "/myDet/myCal/myEMdigiMod" );
|
|---|
| 146 | myDM->Digitize();
|
|---|
| 147 | </programlisting>
|
|---|
| 148 | </informalexample>
|
|---|
| 149 | </para>
|
|---|
| 150 |
|
|---|
| 151 | <para>
|
|---|
| 152 | Also, <emphasis>G4DigiManager</emphasis> has a <emphasis>Digitize()</emphasis>
|
|---|
| 153 | method which takes the unique module name.
|
|---|
| 154 |
|
|---|
| 155 | <informalexample>
|
|---|
| 156 | <programlisting>
|
|---|
| 157 | G4DigiManager * fDM = G4DigiManager::GetDMpointer();
|
|---|
| 158 | MyDigitizer * myDM = fDM->Digitize( "/myDet/myCal/myEMdigiMod" );
|
|---|
| 159 | </programlisting>
|
|---|
| 160 | </informalexample>
|
|---|
| 161 | </para>
|
|---|
| 162 |
|
|---|
| 163 | <!-- ******* Bridgehead ******* -->
|
|---|
| 164 | <bridgehead renderas='sect4'>
|
|---|
| 165 | How to get hitsCollection and/or digiCollection
|
|---|
| 166 | </bridgehead>
|
|---|
| 167 |
|
|---|
| 168 | <para>
|
|---|
| 169 | <emphasis>G4DigiManager</emphasis> has the following methods to access to the
|
|---|
| 170 | hits or digi collections of the currently processing event or of
|
|---|
| 171 | previous events.
|
|---|
| 172 | </para>
|
|---|
| 173 |
|
|---|
| 174 | <para>
|
|---|
| 175 | First, you have to get the collection ID number of the hits or
|
|---|
| 176 | digits collection.
|
|---|
| 177 |
|
|---|
| 178 | <informalexample>
|
|---|
| 179 | <programlisting>
|
|---|
| 180 | G4DigiManager * fDM = G4DigiManager::GetDMpointer();
|
|---|
| 181 | G4int myHitsCollID = fDM->GetHitsCollectionID( "hits_collection_name" );
|
|---|
| 182 | G4int myDigiCollID = fDM->GetDigiCollectionID( "digi_collection_name" );
|
|---|
| 183 | </programlisting>
|
|---|
| 184 | </informalexample>
|
|---|
| 185 | </para>
|
|---|
| 186 |
|
|---|
| 187 | <para>
|
|---|
| 188 | Then, you can get the pointer to your concrete
|
|---|
| 189 | <emphasis>G4THitsCollection</emphasis> object or
|
|---|
| 190 | <emphasis>G4TDigiCollection</emphasis> object of the currently processing event.
|
|---|
| 191 |
|
|---|
| 192 | <informalexample>
|
|---|
| 193 | <programlisting>
|
|---|
| 194 | MyHitsCollection * HC = fDM->GetHitsCollection( myHitsCollID );
|
|---|
| 195 | MyDigiCollection * DC = fDM->GetDigiCollection( myDigiCollID );
|
|---|
| 196 | </programlisting>
|
|---|
| 197 | </informalexample>
|
|---|
| 198 | </para>
|
|---|
| 199 |
|
|---|
| 200 | <para>
|
|---|
| 201 | In case you want to access to the hits or digits collection of
|
|---|
| 202 | previous events, add the second argument.
|
|---|
| 203 |
|
|---|
| 204 | <informalexample>
|
|---|
| 205 | <programlisting>
|
|---|
| 206 | MyHitsCollection * HC = fDM->GetHitsCollection( myHitsCollID, n );
|
|---|
| 207 | MyDigiCollection * DC = fDM->GetDigiCollection( myDigiCollID, n );
|
|---|
| 208 | </programlisting>
|
|---|
| 209 | </informalexample>
|
|---|
| 210 |
|
|---|
| 211 | where, <literal>n</literal> indicates the hits or digits collection of the
|
|---|
| 212 | <literal>n</literal><superscript>th</superscript> previous event.
|
|---|
| 213 | </para>
|
|---|
| 214 |
|
|---|
| 215 | </sect2>
|
|---|
| 216 | </sect1>
|
|---|