#include <CaloOnlineTools/EcalTools/data/macro/Geom.h>
Public Types | |
enum | GeomPeriod_t { Undef, Year2003, Spring2004, Automn2004, Undef, Year2003, Spring2004, Automn2004, Undef, Year2003, Spring2004, Automn2004 } |
enum | GeomPeriod_t { Undef, Year2003, Spring2004, Automn2004, Undef, Year2003, Spring2004, Automn2004, Undef, Year2003, Spring2004, Automn2004 } |
enum | GeomPeriod_t { Undef, Year2003, Spring2004, Automn2004, Undef, Year2003, Spring2004, Automn2004, Undef, Year2003, Spring2004, Automn2004 } |
enum | SMGeom_t { kSModulesInEcal = 36, kModules = 4, kTriggerTowers = 68, kTTandMems = 70, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsWithMems = 1750, kCrystalsM1 = 500, kCrystalsM2 = 400, kCrystalsM3 = 400, kCrystalsM4 = 400, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsInEtaM1 = 25, kCrystalsInEtaM2 = 20, kCrystalsInEtaM3 = 20, kCrystalsInEtaM4 = 20, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, kSamplesInEvent = 10, kSamplesInPNEvent = 50, kPNs = 10, kSModulesInEcal = 36, kModules = 4, kTriggerTowers = 68, kTTandMems = 70, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsWithMems = 1750, kCrystalsM1 = 500, kCrystalsM2 = 400, kCrystalsM3 = 400, kCrystalsM4 = 400, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsInEtaM1 = 25, kCrystalsInEtaM2 = 20, kCrystalsInEtaM3 = 20, kCrystalsInEtaM4 = 20, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, kSamplesInEvent = 10, kSamplesInPNEvent = 50, kPNs = 10, kModules = 4, kTriggerTowers = 68, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5 } |
enum | SMGeom_t { kSModulesInEcal = 36, kModules = 4, kTriggerTowers = 68, kTTandMems = 70, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsWithMems = 1750, kCrystalsM1 = 500, kCrystalsM2 = 400, kCrystalsM3 = 400, kCrystalsM4 = 400, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsInEtaM1 = 25, kCrystalsInEtaM2 = 20, kCrystalsInEtaM3 = 20, kCrystalsInEtaM4 = 20, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, kSamplesInEvent = 10, kSamplesInPNEvent = 50, kPNs = 10, kSModulesInEcal = 36, kModules = 4, kTriggerTowers = 68, kTTandMems = 70, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsWithMems = 1750, kCrystalsM1 = 500, kCrystalsM2 = 400, kCrystalsM3 = 400, kCrystalsM4 = 400, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsInEtaM1 = 25, kCrystalsInEtaM2 = 20, kCrystalsInEtaM3 = 20, kCrystalsInEtaM4 = 20, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, kSamplesInEvent = 10, kSamplesInPNEvent = 50, kPNs = 10, kModules = 4, kTriggerTowers = 68, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5 } |
enum | SMGeom_t { kSModulesInEcal = 36, kModules = 4, kTriggerTowers = 68, kTTandMems = 70, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsWithMems = 1750, kCrystalsM1 = 500, kCrystalsM2 = 400, kCrystalsM3 = 400, kCrystalsM4 = 400, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsInEtaM1 = 25, kCrystalsInEtaM2 = 20, kCrystalsInEtaM3 = 20, kCrystalsInEtaM4 = 20, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, kSamplesInEvent = 10, kSamplesInPNEvent = 50, kPNs = 10, kSModulesInEcal = 36, kModules = 4, kTriggerTowers = 68, kTTandMems = 70, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsWithMems = 1750, kCrystalsM1 = 500, kCrystalsM2 = 400, kCrystalsM3 = 400, kCrystalsM4 = 400, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsInEtaM1 = 25, kCrystalsInEtaM2 = 20, kCrystalsInEtaM3 = 20, kCrystalsInEtaM4 = 20, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5, kSamplesInEvent = 10, kSamplesInPNEvent = 50, kPNs = 10, kModules = 4, kTriggerTowers = 68, kTowersInPhi = 4, kTowersInEta = 17, kCrystals = 1700, kCrystalsInPhi = 20, kCrystalsInEta = 85, kCrystalsPerTower = 25, kCardsPerTower = 5, kChannelsPerCard = 5 } |
Public Member Functions | |
void | getCrystalCoord (int &eta, int &phi, int smCrystal) const |
void | getCrystalCoord (int &eta, int &phi, int smCrystal) const |
void | getCrystalCoord (int &eta, int &phi, int smCrystal) const |
Returns the crystal coordinates (eta, phi index) for a given crystal number in the super module. | |
GeomPeriod_t | GetGeomPeriod () const |
GeomPeriod_t | GetGeomPeriod () const |
GeomPeriod_t | GetGeomPeriod () const |
int | getHalf (int TT) |
int | getHalf (int TT) |
int | getLeft (int smCrystal) const |
int | getLeft (int smCrystal) const |
int | getLeft (int smCrystal) const |
Returns left neighbour of a sm crystal. | |
int | getLower (int smCrystal) const |
int | getLower (int smCrystal) const |
int | getLower (int smCrystal) const |
Returns lower neighbour of a sm crystal. | |
int | getRight (int smCrystal) const |
int | getRight (int smCrystal) const |
int | getRight (int smCrystal) const |
Returns right neighbour of a sm crystal. | |
int | getSMCrystalFromCoord (int eta, int phi) const |
int | getSMCrystalFromCoord (int eta, int phi) const |
int | getSMCrystalFromCoord (int eta, int phi) const |
Retuns the crystal number in the super module for given coordinates. | |
int | getSMCrystalNumber (int tower, int crystal) const |
int | getSMCrystalNumber (int tower, int strip_id, int crystal_id) const |
int | getSMCrystalNumber (int tower, int crystal) const |
int | getSMCrystalNumber (int tower, int strip_id, int crystal_id) const |
int | getSMCrystalNumber (int tower, int crystal) const |
Retuns the crystal number in the super module for a given tower number in the super module and crystal number in the tower. | |
void | getTower (int *tower, int towerNb, std::string order="geom") const |
void | getTower (int *tower, int towerNb, std::string order="geom") const |
void | getTower (int *tower, int towerNb, std::string order="geom") const |
Returns the 25 crystals of tower towerNb in the super module. | |
int | getTowerCrystalNumber (int smTowerNb, int crystalNbGeom) const |
void | getTowerCrystalNumber (int &tower, int &crystal, int smCrystal) const |
int | getTowerCrystalNumber (int smTowerNb, int crystalNbGeom) const |
void | getTowerCrystalNumber (int &tower, int &crystal, int smCrystal) const |
int | getTowerCrystalNumber (int smTowerNb, int crystalNbGeom) const |
Returns the crystal number (readout order) in a tower for a given position in the tower (crystalNbGeom=0 is the lower-right corner and crystalNbGeom=24 is the upper-left corner, see scheme in H4Geom::getTower). | |
void | getTowerCrystalNumber (int &tower, int &crystal, int smCrystal) const |
Returns the crystal number in a tower for a given crystal number in the super module. | |
void | getTowerStripChannelNumber (int &tower, int &strip_id, int &crystal_id, int sm_num) const |
void | getTowerStripChannelNumber (int &tower, int &strip_id, int &crystal_id, int sm_num) const |
int | getUpper (int smCrystal) const |
int | getUpper (int smCrystal) const |
int | getUpper (int smCrystal) const |
Returns upper neighbour of a sm crystal. | |
void | getVFE (int *VFE, int smCrystal, std::string order="geom") const |
void | getVFE (int *VFE, int smCrystal, std::string order="geom") const |
void | getVFE (int *VFE, int smCrystal, std::string order="geom") const |
Returns the 5 crystals belonging to the same VFE board as smCrystal. | |
void | getWindow (int *window, int smCrystal, int width, int height) const |
void | getWindow (int *window, int smCrystal, int width, int height) const |
void | getWindow (int *window, int smCrystal, int width, int height) const |
Returns sm crystal numbers for crystals in a window of size widthxheight centered around a given smCrystal. | |
H4Geom () | |
H4Geom () | |
H4Geom () | |
bool | init () |
bool | init () |
bool | init () |
Initialize geometry with config file. | |
bool | isInFirstHalf (int numberInSM) |
bool | isInFirstHalf (int numberInSM) |
bool | leftTower (int tower) const |
bool | leftTower (int tower) const |
bool | leftTower (int tower) const |
Tests if low voltage board is on the left size of the tower. | |
void | mvDown (int &eta, int &phi) const |
void | mvDown (int &eta, int &phi) const |
void | mvDown (int &eta, int &phi) const |
Returns lower neighbour of a crystal referenced by its coordinates. | |
void | mvLeft (int &eta, int &phi) const |
void | mvLeft (int &eta, int &phi) const |
void | mvLeft (int &eta, int &phi) const |
Returns left neighbour of a crystal referenced by its coordinates. | |
void | mvRight (int &eta, int &phi) const |
void | mvRight (int &eta, int &phi) const |
void | mvRight (int &eta, int &phi) const |
Returns right neighbour of a crystal referenced by its coordinates. | |
void | mvUp (int &eta, int &phi) const |
void | mvUp (int &eta, int &phi) const |
void | mvUp (int &eta, int &phi) const |
Returns upper neighbour of a crystal referenced by its coordinates. | |
bool | rightTower (int tower) const |
bool | rightTower (int tower) const |
bool | rightTower (int tower) const |
Tests if low voltage board is on the right size of the tower. | |
virtual | ~H4Geom () |
virtual | ~H4Geom () |
virtual | ~H4Geom () |
does nothing | |
Static Public Member Functions | |
static void | SetGeomPeriod (GeomPeriod_t geometry) |
static void | SetGeomPeriod (GeomPeriod_t geometry) |
static void | SetGeomPeriod (GeomPeriod_t geometry) |
Private Member Functions | |
bool | IsGeomPeriodDefined () const |
bool | IsGeomPeriodDefined () const |
bool | IsGeomPeriodDefined () const |
Static Private Attributes | |
static const int | crystalChannelMap [5][5] |
static const int | crystalMap [25] |
static GeomPeriod_t | geometry_ = H4Geom::Undef |
static const int | WhichHalf [69] |
Crystal numbering schemes during automn 2004 (SM10):
* <- eta * +--+--+--+--+--+ +--+--+--+--+--+ * | 4| 5|14|15|24| |20|19|10| 9| 0| * +--+--+--+--+--+ +--+--+--+--+--+ * | 3| 6|13|16|23| |21|18|11| 8| 1| * +--+--+--+--+--+ +--+--+--+--+--+ || * | 2| 7|12|17|22| |22|17|12| 7| 2| || phi * +--+--+--+--+--+ +--+--+--+--+--+ \/ * | 1| 8|11|18|21| |23|16|12| 6| 3| * +--+--+--+--+--+ +--+--+--+--+--+ * | 0| 9|10|19|20| |24|15|14| 5| 4| * +--+--+--+--+--+ +--+--+--+--+--+ * left tower right tower *
*(i = 84, j = 0) <- eta (i = 0, j = 0) * +----+----+ +----+----+----+----+----+----+ * |1681|1661| ... | 101| 81| 61| 41| 21| 1| * +----+----+ +----+----+----+----+----+----+ * |1682|1662| ... | 102| 82| 62| 42| 22| 2| * +----+----+ +----+----+----+----+----+----+ * ... || | * +----+----+ +----+----+----+----+----+----+ || phi | * |1698|1678| ... | 118| 98| 78| 58| 38| 18| \/ |t * +----+----+ +----+----+----+----+----+----+ |o * |1699|1679| ... | 119| 99| 79| 59| 39| 19| |w * +----+----+ +----+----+----+----+----+----+ |e * |1700|1680| ... | 120| 100| 80| 60| 40| 20| |r * +----+----+ +----+----+----+----+----+----+ | *(i = 84, j = 19) (i = 0, j = 19) * --------- tower ---------- *
the logic to determine i and j from smTower and crystal readout number is: if (tower is left) i = (smTower - 1)/4 * 5 + (24 - crystal)/5 else i = (smTower - 1)/4 * 5 + crystal/5 if (tower is left && (crystal/5)2 = 0 || tower is right && (crystal/5)2 = 1) j = (smTower - 1)4 * 5 + 4 - crystal5 else j = (smTower - 1)4 * 5 + crystal5 conversly smTower = i/5 * 4 + j/5 + 1 if (tower is left) if ((i5)2 = 0) crystal = (4 - i5)*5 + 4 - j5 else crystal = (4 - i5)*5 + j5 else if ((i5)2 = 0) crystal = i5 * 5 + j5 else crystal = i5 * 5 + 4 - j5
Crystal numbering schemes in 2003:
* <- eta * +--+--+--+--+--+ +--+--+--+--+--+ * | 4| 5|14|15|24| |20|19|10| 9| 0| * +--+--+--+--+--+ +--+--+--+--+--+ * | 3| 6|13|16|23| |21|18|11| 8| 1| * +--+--+--+--+--+ +--+--+--+--+--+ ^ * | 2| 7|12|17|22| |22|17|12| 7| 2| | phi * +--+--+--+--+--+ +--+--+--+--+--+ | * | 1| 8|11|18|21| |23|16|12| 6| 3| * +--+--+--+--+--+ +--+--+--+--+--+ * | 0| 9|10|19|20| |24|15|14| 5| 4| * +--+--+--+--+--+ +--+--+--+--+--+ * left tower right tower *
* <- eta * +----+----+ +----+----+----+----+----+----+ * |1699|1698| ... |1620|1919|1618|1617|1616|1615| * +----+----+ +----+----+----+----+----+----+ * |1614|1613| ... |1535|1534|1533|1532|1531|1530| * +----+----+ +----+----+----+----+----+----+ ^ * ... | phi | * +----+----+ +----+----+----+----+----+----+ | | * | 254| 253| ... | 175| 174| 173| 172| 171| 170| |t * +----+----+ +----+----+----+----+----+----+ |o * | 169| 168| ... | 90| 89| 88| 87| 86| 85| |w * +----+----+ +----+----+----+----+----+----+ |e * | 84| 83| ... | 5| 4| 3| 2| 1| 0| |r * +----+----+ +----+----+----+----+----+----+ | * * --------- tower ---------- *
* <- eta * +--+--+--+--+--+ * |24|19|14| 9| 4| * +--+--+--+--+--+ * |23|18|13| 8| 3| ^ * +--+--+--+--+--+ | phi * |22|17|12| 7| 2| | * +--+--+--+--+--+ * |21|16|11| 6| 1| * +--+--+--+--+--+ * |20|15|10| 5| 0| * +--+--+--+--+--+ *
The H4Geom class is providing methods to convert these numbers into each other.
Definition at line 15 of file Geom.h.
enum H4Geom::GeomPeriod_t |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 | |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 | |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 |
Definition at line 20 of file H4Geom.h.
00020 { 00021 Undef, // Cause the program to crash 00022 Year2003, // Test beam during 2003: SM0 and SM1 00023 Spring2004, // June-July 2004: E0' tests 00024 Automn2004 // Tests of one full supermodule 00025 };
enum H4Geom::GeomPeriod_t |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 | |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 | |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 |
Definition at line 20 of file Geom.h.
00020 { 00021 Undef, // Cause the program to crash 00022 Year2003, // Test beam during 2003: SM0 and SM1 00023 Spring2004, // June-July 2004: E0' tests 00024 Automn2004 // Tests of one full supermodule 00025 };
enum H4Geom::GeomPeriod_t |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 | |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 | |
Undef | |
Year2003 | |
Spring2004 | |
Automn2004 |
Definition at line 19 of file Geom.h.
00019 { 00020 Undef, // Cause the program to crash 00021 Year2003, // Test beam during 2003: SM0 and SM1 00022 Spring2004, // June-July 2004: E0' tests 00023 Automn2004 // Tests of one full supermodule 00024 };
enum H4Geom::SMGeom_t |
Definition at line 28 of file H4Geom.h.
00028 { 00029 kModules = 4, // Number of modules per supermodule 00030 kTriggerTowers = 68, // Number of trigger towers per supermodule 00031 kTowersInPhi = 4, // Number of trigger towers in phi 00032 kTowersInEta = 17, // Number of trigger towers in eta 00033 kCrystals = 1700, // Number of crystals per supermodule 00034 kCrystalsInPhi = 20, // Number of crystals in phi 00035 kCrystalsInEta = 85, // Number of crystals in eta 00036 kCrystalsPerTower = 25, // Number of crystals per trigger tower 00037 kCardsPerTower = 5, // Number of VFE cards per trigger tower 00038 kChannelsPerCard = 5 // Number of channels per VFE card 00039 };
enum H4Geom::SMGeom_t |
Definition at line 28 of file Geom.h.
00028 { 00029 kSModulesInEcal = 36, // Number of Super Modules in whole ECAL 00030 kModules = 4, // Number of modules per supermodule 00031 kTriggerTowers = 68, // Number of trigger towers per supermodule 00032 kTTandMems = 70, // Number of tt per supermodule, including MEM boxes 00033 kTowersInPhi = 4, // Number of trigger towers in phi 00034 kTowersInEta = 17, // Number of trigger towers in eta 00035 kCrystals = 1700, // Number of crystals per supermodule 00036 kCrystalsWithMems = 1750, // Number of channels per supermodule, mem included 00037 kCrystalsM1 = 500, // Number of crystals per supermodule 00038 kCrystalsM2 = 400, // Number of crystals per supermodule 00039 kCrystalsM3 = 400, // Number of crystals per supermodule 00040 kCrystalsM4 = 400, // Number of crystals per supermodule 00041 kCrystalsInPhi = 20, // Number of crystals in phi 00042 kCrystalsInEta = 85, // Number of crystals in eta 00043 kCrystalsInEtaM1 = 25, // Number of crystals in eta for module 1 00044 kCrystalsInEtaM2 = 20, // Number of crystals in eta for module 2 00045 kCrystalsInEtaM3 = 20, // Number of crystals in eta for module 3 00046 kCrystalsInEtaM4 = 20, // Number of crystals in eta for module 4 00047 kCrystalsPerTower = 25, // Number of crystals per trigger tower 00048 kCardsPerTower = 5, // Number of VFE cards per trigger tower 00049 kChannelsPerCard = 5, // Number of channels per VFE card 00050 kSamplesInEvent = 10, // Number of samples in event 00051 kSamplesInPNEvent = 50, // Number of samples in event 00052 kPNs = 10 // number of pn diode for laser monitoring (number [0,9]) 00053 };
enum H4Geom::SMGeom_t |
Definition at line 27 of file Geom.h.
00027 { 00028 kSModulesInEcal = 36, // Number of Super Modules in whole ECAL 00029 kModules = 4, // Number of modules per supermodule 00030 kTriggerTowers = 68, // Number of trigger towers per supermodule 00031 kTTandMems = 70, // Number of tt per supermodule, including MEM boxes 00032 kTowersInPhi = 4, // Number of trigger towers in phi 00033 kTowersInEta = 17, // Number of trigger towers in eta 00034 kCrystals = 1700, // Number of crystals per supermodule 00035 kCrystalsWithMems = 1750, // Number of channels per supermodule, mem included 00036 kCrystalsM1 = 500, // Number of crystals per supermodule 00037 kCrystalsM2 = 400, // Number of crystals per supermodule 00038 kCrystalsM3 = 400, // Number of crystals per supermodule 00039 kCrystalsM4 = 400, // Number of crystals per supermodule 00040 kCrystalsInPhi = 20, // Number of crystals in phi 00041 kCrystalsInEta = 85, // Number of crystals in eta 00042 kCrystalsInEtaM1 = 25, // Number of crystals in eta for module 1 00043 kCrystalsInEtaM2 = 20, // Number of crystals in eta for module 2 00044 kCrystalsInEtaM3 = 20, // Number of crystals in eta for module 3 00045 kCrystalsInEtaM4 = 20, // Number of crystals in eta for module 4 00046 kCrystalsPerTower = 25, // Number of crystals per trigger tower 00047 kCardsPerTower = 5, // Number of VFE cards per trigger tower 00048 kChannelsPerCard = 5, // Number of channels per VFE card 00049 kSamplesInEvent = 10, // Number of samples in event 00050 kSamplesInPNEvent = 50, // Number of samples in event 00051 kPNs = 10 // number of pn diode for laser monitoring (number [0,9]) 00052 };
H4Geom::H4Geom | ( | ) |
Definition at line 194 of file H4Geom.cc.
References Automn2004, and SetGeomPeriod().
00195 { 00196 GeomPeriod_t ForFilesConversion; 00197 ForFilesConversion = Automn2004; 00198 H4Geom::SetGeomPeriod(ForFilesConversion); 00199 }
H4Geom::H4Geom | ( | ) |
virtual H4Geom::~H4Geom | ( | ) | [virtual] |
H4Geom::H4Geom | ( | ) |
virtual H4Geom::~H4Geom | ( | ) | [virtual] |
Returns the crystal coordinates (eta, phi index) for a given crystal number in the super module.
Definition at line 322 of file H4Geom.cc.
References Automn2004, geometry_, kChannelsPerCard, kCrystalsInEta, kCrystalsPerTower, kTowersInPhi, and Spring2004.
Referenced by getVFE(), getWindow(), and isInFirstHalf().
00323 { 00324 if (geometry_ == H4Geom::Spring2004) { 00325 eta = (smCrystal - 1)/kChannelsPerCard; // arbitrary units 00326 phi = kChannelsPerCard - 1 - 00327 ((smCrystal - 1)%kCrystalsPerTower)%kChannelsPerCard; 00328 } else if (geometry_ == H4Geom::Automn2004) { 00329 eta = (smCrystal - 1)/(kChannelsPerCard*kTowersInPhi); 00330 phi = (smCrystal - 1)%(kChannelsPerCard*kTowersInPhi); 00331 } else { 00332 eta = smCrystal%kCrystalsInEta; 00333 phi = smCrystal/kCrystalsInEta; 00334 } 00335 }
GeomPeriod_t H4Geom::GetGeomPeriod | ( | ) | const [inline] |
GeomPeriod_t H4Geom::GetGeomPeriod | ( | ) | const [inline] |
GeomPeriod_t H4Geom::GetGeomPeriod | ( | ) | const [inline] |
Returns left neighbour of a sm crystal.
Input and output are crystal numbers in the super module. A negative output means outside of the supermodule.
Definition at line 360 of file H4Geom.cc.
References Automn2004, geometry_, IsGeomPeriodDefined(), kChannelsPerCard, kCrystals, kCrystalsInEta, kCrystalsInPhi, kCrystalsPerTower, and Spring2004.
00361 { 00362 if (!IsGeomPeriodDefined()) abort(); 00363 if (geometry_ == H4Geom::Spring2004) { 00364 smCrystal += kChannelsPerCard; 00365 if (smCrystal > 2*kCrystalsPerTower || smCrystal < 1) return -1; 00366 return smCrystal; 00367 } else if (geometry_ == H4Geom::Automn2004) { 00368 smCrystal += kCrystalsInPhi; 00369 if (smCrystal > kCrystals) return -1; 00370 return smCrystal; 00371 } else { 00372 smCrystal++; 00373 if (!(smCrystal % kCrystalsInEta)) return -1; 00374 if (smCrystal >= kCrystals || smCrystal < 0) return -1; 00375 return smCrystal; 00376 } 00377 }
Returns lower neighbour of a sm crystal.
Input and output are crystal numbers in the super module. A negative output means outside of the supermodule.
Definition at line 427 of file H4Geom.cc.
References Automn2004, geometry_, IsGeomPeriodDefined(), kCrystals, kCrystalsInEta, kCrystalsInPhi, kCrystalsPerTower, and Spring2004.
00428 { 00429 if (!IsGeomPeriodDefined()) abort(); 00430 if (geometry_ == H4Geom::Spring2004) { 00431 smCrystal ++; 00432 if (smCrystal > 2*kCrystalsPerTower || smCrystal < 1) return -1; 00433 return smCrystal; 00434 } else if (geometry_ == H4Geom::Automn2004) { 00435 if (smCrystal%kCrystalsInPhi == 0) return -1; // phi = 19 00436 smCrystal++; 00437 return smCrystal; 00438 } else { 00439 smCrystal -= kCrystalsInEta; 00440 if (smCrystal >= kCrystals || smCrystal < 0) return -1; 00441 return smCrystal; 00442 } 00443 }
Returns right neighbour of a sm crystal.
Input and output are crystal numbers in the super module. A negative output means outside of the supermodule.
Definition at line 383 of file H4Geom.cc.
References Automn2004, geometry_, IsGeomPeriodDefined(), kChannelsPerCard, kCrystals, kCrystalsInEta, kCrystalsInPhi, kCrystalsPerTower, and Spring2004.
00384 { 00385 if (!IsGeomPeriodDefined()) abort(); 00386 if (geometry_ == H4Geom::Spring2004) { 00387 smCrystal -= kChannelsPerCard; 00388 if (smCrystal > 2*kCrystalsPerTower || smCrystal < 1) return -1; 00389 return smCrystal; 00390 } else if (geometry_ == H4Geom::Automn2004) { 00391 smCrystal -= kCrystalsInPhi; 00392 if (smCrystal < 0) return -1; 00393 return smCrystal; 00394 } else { 00395 smCrystal--; 00396 if (smCrystal % kCrystalsInEta == kCrystalsInEta - 1) return -1; 00397 if (smCrystal >= kCrystals || smCrystal < 0) return -1; 00398 return smCrystal; 00399 } 00400 }
Retuns the crystal number in the super module for given coordinates.
Definition at line 339 of file H4Geom.cc.
References Automn2004, geometry_, kCardsPerTower, kChannelsPerCard, kCrystalsInEta, kCrystalsInPhi, kTowersInPhi, and Spring2004.
Referenced by getWindow().
00340 { 00341 if (geometry_ == H4Geom::Spring2004) { 00342 if (eta >= 9 || eta < 0 || phi >= 4 || phi < 0) 00343 return -1; // Only two supercrystals 00344 return eta*kCardsPerTower + (kChannelsPerCard - phi); 00345 } 00346 if (eta < 0 || eta >= kCrystalsInEta || phi < 0 || phi >= kCrystalsInPhi) 00347 return -1; // non real smCrystal 00348 else { 00349 if (geometry_ == H4Geom::Automn2004) 00350 return eta*kChannelsPerCard*kTowersInPhi + phi + 1; 00351 else 00352 return eta + kCrystalsInEta*phi; 00353 } 00354 }
Retuns the crystal number in the super module for a given tower number in the super module and crystal number in the tower.
Definition at line 218 of file H4Geom.cc.
References Automn2004, crystalMap, eta, geometry_, int, IsGeomPeriodDefined(), kCardsPerTower, kChannelsPerCard, kCrystalsPerTower, kTowersInPhi, parsecf::pyparsing::line(), phi, rightTower(), and Spring2004.
Referenced by getTower(), getVFE(), and Ecal2004TBSource::produce().
00219 { 00220 if (!IsGeomPeriodDefined()) abort(); 00221 if (geometry_ == H4Geom::Spring2004) { 00222 int smCrystalNbr = 0; 00223 if ((crystal/5)%2 == 0) 00224 smCrystalNbr = kCrystalsPerTower - 00225 int(crystal/kCardsPerTower)*kChannelsPerCard - 00226 crystal%kChannelsPerCard + (tower - 1)*kCrystalsPerTower; 00227 else 00228 smCrystalNbr = kCrystalsPerTower + 1 - 00229 (int(crystal/kCardsPerTower) + 1)*kChannelsPerCard + 00230 crystal%kChannelsPerCard + (tower - 1)*kCrystalsPerTower; 00231 return smCrystalNbr; 00232 } else if (geometry_ == H4Geom::Automn2004) { 00233 int eta = (tower - 1)/kTowersInPhi*kCardsPerTower; 00234 int phi = (tower - 1)%kTowersInPhi*kChannelsPerCard; 00235 if (rightTower(tower)) 00236 eta += crystal/kCardsPerTower; 00237 else 00238 eta += (kCrystalsPerTower - 1 - crystal)/kCardsPerTower; 00239 if (rightTower(tower) && (crystal/kCardsPerTower)%2 == 1 || 00240 !rightTower(tower) && (crystal/kCardsPerTower)%2 == 0) 00241 phi += (kChannelsPerCard - 1 - crystal%kChannelsPerCard); 00242 else 00243 phi += crystal%kChannelsPerCard; 00244 return eta*kChannelsPerCard*kTowersInPhi + phi + 1; 00245 } else { 00246 int towerId = tower - 1; 00247 int line = towerId%4; 00248 int column = towerId/4; 00249 int lowerRight = 5*line*85 + column*5; 00250 if (rightTower(tower)) 00251 return lowerRight+crystalMap[crystal]; 00252 else 00253 return lowerRight+crystalMap[24-crystal]; 00254 } 00255 }
Returns the 25 crystals of tower towerNb in the super module.
Output are crystal numbers in the super module. By default, the order in the output array (tower) corresponds to geometric order (index 0 is lower-right corner). if order=readout, the order in the output array (tower) corresponds to the readout scheme (depends on the kind of tower) the geometric order is defined by:
* +--+--+--+--+--+ * |24|19|14| 9| 4| * +--+--+--+--+--+ * |23|18|13| 8| 3| * +--+--+--+--+--+ * |22|17|12| 7| 2| * +--+--+--+--+--+ * |21|16|11| 6| 1| * +--+--+--+--+--+ * |20|15|10| 5| 0| * +--+--+--+--+--+ *
Definition at line 510 of file H4Geom.cc.
References Automn2004, geometry_, getSMCrystalNumber(), i, IsGeomPeriodDefined(), kCardsPerTower, kChannelsPerCard, kCrystalsInEta, kCrystalsInPhi, kCrystalsPerTower, kTowersInPhi, and parsecf::pyparsing::line().
00511 { 00512 if (!IsGeomPeriodDefined()) abort(); 00513 if (order == "readout") { 00514 for (int crystalNb = 0; crystalNb < kCrystalsPerTower; crystalNb++) 00515 tower[crystalNb] = getSMCrystalNumber(towerNb, crystalNb); 00516 } else { 00517 int towerId = towerNb - 1; 00518 int line = towerId%kTowersInPhi; 00519 int column = towerId/kTowersInPhi; 00520 if (geometry_ == H4Geom::Automn2004) { 00521 int smLowerRight = column*kCardsPerTower*kCrystalsInPhi + 00522 (line + 1)*kChannelsPerCard; 00523 for (int i = 0; i < kCrystalsPerTower; i++) 00524 tower[i] = smLowerRight - i%kChannelsPerCard + 00525 i/kChannelsPerCard*kCrystalsInPhi; 00526 } else { 00527 int smLowerRight = kChannelsPerCard*line*kCrystalsInEta + 00528 column*kCardsPerTower; 00529 for (int i = 0; i < kCrystalsPerTower; i++) 00530 tower[i] = i%kChannelsPerCard * kCrystalsInEta + 00531 i/kChannelsPerCard + smLowerRight; 00532 } 00533 } 00534 return; 00535 }
Returns the crystal number (readout order) in a tower for a given position in the tower (crystalNbGeom=0 is the lower-right corner and crystalNbGeom=24 is the upper-left corner, see scheme in H4Geom::getTower).
Definition at line 309 of file H4Geom.cc.
References crystalChannelMap, kCardsPerTower, kChannelsPerCard, kCrystalsPerTower, leftTower(), and parsecf::pyparsing::line().
00310 { 00311 if (crystalNbGeom < 0 || crystalNbGeom >= kCrystalsPerTower) return -1 ; 00312 int column = crystalNbGeom/kCardsPerTower; 00313 int line = crystalNbGeom%kChannelsPerCard; 00314 int crystal = crystalChannelMap[line][column]; 00315 if (leftTower(smTowerNb)) crystal = kCrystalsPerTower - 1 - crystal; 00316 return crystal; 00317 }
Returns the crystal number in a tower for a given crystal number in the super module.
Definition at line 260 of file H4Geom.cc.
References Automn2004, crystalChannelMap, eta, geometry_, int, IsGeomPeriodDefined(), kCardsPerTower, kChannelsPerCard, kCrystalsPerTower, kTowersInPhi, leftTower(), parsecf::pyparsing::line(), phi, rightTower(), and Spring2004.
Referenced by getVFE().
00261 { 00262 if (!IsGeomPeriodDefined()) abort(); 00263 if (geometry_ == H4Geom::Spring2004) { 00264 // We do not know where the supercrystal is... 00265 tower = (smCrystal - 1)/kCrystalsPerTower + 1; 00266 smCrystal -= (tower - 1)*kCrystalsPerTower; 00267 if (((smCrystal - 1)/kCardsPerTower)%2 == 0) 00268 crystal = (kCardsPerTower - 00269 int((smCrystal - 1)/kCardsPerTower))*kCardsPerTower - 00270 (smCrystal - 1)%kCardsPerTower - 1; 00271 else 00272 crystal = (kCardsPerTower - 1 - 00273 int((smCrystal - 1)/kCardsPerTower))*kCardsPerTower + 00274 (smCrystal - 1)%kCardsPerTower; 00275 return; 00276 } else if (geometry_ == H4Geom::Automn2004) { 00277 int eta = (smCrystal - 1)/(kChannelsPerCard*kTowersInPhi); 00278 int phi = (smCrystal - 1)%(kChannelsPerCard*kTowersInPhi); 00279 tower = eta/kCardsPerTower*kTowersInPhi + phi/kChannelsPerCard + 1; 00280 if (rightTower(tower)) { 00281 crystal = (eta%kCardsPerTower)*kChannelsPerCard; 00282 if ((eta%kChannelsPerCard)%2 == 0) 00283 crystal += phi%kChannelsPerCard; 00284 else 00285 crystal += kChannelsPerCard - 1 - phi%kChannelsPerCard; 00286 } else { 00287 crystal = (kCardsPerTower - 1 - eta%kCardsPerTower)*kChannelsPerCard; 00288 if ((eta%kChannelsPerCard)%2 == 0) 00289 crystal += kChannelsPerCard - 1 - phi%kChannelsPerCard; 00290 else 00291 crystal += phi%kChannelsPerCard; 00292 } 00293 } else { 00294 int line = smCrystal/85; 00295 int cInLine = smCrystal%85; 00296 00297 tower= 1 + (cInLine/5) * 4 + line/5; // tower number in SM 00298 crystal = crystalChannelMap[line%5][cInLine%5]; 00299 if (leftTower(tower)) crystal = 24-crystal ; 00300 } 00301 return; 00302 }
void H4Geom::getTowerStripChannelNumber | ( | int & | tower, | |
int & | strip_id, | |||
int & | crystal_id, | |||
int | sm_num | |||
) | const |
void H4Geom::getTowerStripChannelNumber | ( | int & | tower, | |
int & | strip_id, | |||
int & | crystal_id, | |||
int | sm_num | |||
) | const |
Returns upper neighbour of a sm crystal.
Input and output are crystal numbers in the super module. A negative output means outside of the supermodule.
Definition at line 406 of file H4Geom.cc.
References Automn2004, geometry_, IsGeomPeriodDefined(), kCrystals, kCrystalsInEta, kCrystalsInPhi, kCrystalsPerTower, and Spring2004.
00406 { 00407 if (!IsGeomPeriodDefined()) abort(); 00408 if (geometry_ == H4Geom::Spring2004) { 00409 smCrystal--; 00410 if (smCrystal > 2*kCrystalsPerTower || smCrystal < 1) return -1; 00411 return smCrystal; 00412 } else if (geometry_ == H4Geom::Automn2004) { 00413 if ((smCrystal - 1)%kCrystalsInPhi == 0) return -1; // phi = 0 00414 smCrystal--; 00415 return smCrystal; 00416 } else { 00417 smCrystal += kCrystalsInEta; 00418 if (smCrystal >= kCrystals || smCrystal < 0) return -1; 00419 return smCrystal; 00420 } 00421 }
Returns the 5 crystals belonging to the same VFE board as smCrystal.
Input and output are crystal numbers in the super module. By default, the order in the output array (VFE) corresponds to The geometric order (index 0 is lower-right corner). if order=readout, the order in the output array (VFE) corresponds to the readout scheme (depends on the kind of tower) the geometric order is defined by:
* +-+ * |4| * +-+ * |3| * +-+ * |2| * +-+ * |1| * +-+ * |0| * +-+ *
Definition at line 560 of file H4Geom.cc.
References eta, getCrystalCoord(), getSMCrystalNumber(), getTowerCrystalNumber(), i, kChannelsPerCard, and phi.
00561 { 00562 int towerNb, crystalNb; 00563 getTowerCrystalNumber(towerNb, crystalNb, smCrystal); 00564 int VFEnb = crystalNb/kChannelsPerCard; 00565 if (order == "readout") { 00566 for (crystalNb = 0; crystalNb < kChannelsPerCard; crystalNb++) 00567 VFE[crystalNb] = getSMCrystalNumber(towerNb, 00568 kChannelsPerCard*VFEnb+crystalNb); 00569 } else { 00570 int eta, phi; 00571 getCrystalCoord(eta, phi, smCrystal); 00572 int smLower = eta+85*5*(phi/5); 00573 for (int i = 0; i < 5; i++) 00574 VFE[i] = i*85 + smLower; 00575 } 00576 }
Returns sm crystal numbers for crystals in a window of size widthxheight centered around a given smCrystal.
width and height must be odd. The order in the output array (window) is defined by the geometric order (index 0 is lower-right corner). the geometric order is defined by:
* width (w) * <---------------------> * +---------------------+ - * | h*w . . . . . . h| | * | . . .| | * | . . .| | h * | . . .| | e * | . . . . x . . . .| | i (h) * | . . .| | g * | . . .| | h * | . . .| | t * | . . 1| | * | . . . . . . . h+1 0| | * +---------------------+ - * * x: central crystal *
Definition at line 604 of file H4Geom.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), eta, getCrystalCoord(), getSMCrystalFromCoord(), i, index, j, and phi.
00605 { 00606 if (width <= 0 || width%2 == 0) { 00607 std::cout << "H4Geom::getWindow, width should be >0 and odd!" << std::endl; 00608 return; 00609 } 00610 if (height <= 0 || height%2 == 0) { 00611 std::cout << "H4Geom::getWindow, height should be >0 and odd!" 00612 << std::endl; 00613 return; 00614 } 00615 int eta, phi; 00616 getCrystalCoord(eta, phi, smCrystal); 00617 // get lower-right corner 00618 int eta0 = eta - (width - 1)/2; 00619 int phi0 = phi - (height - 1)/2; 00620 int index = 0; 00621 eta = eta0; 00622 phi = phi0; 00623 for (int i = 0; i < width; i++) { 00624 for (int j = 0; j < height; j++) { 00625 window[index] = getSMCrystalFromCoord(eta, phi); 00626 phi++; 00627 index++; 00628 } 00629 eta++; 00630 phi = phi0; 00631 } 00632 }
bool H4Geom::init | ( | ) |
bool H4Geom::init | ( | ) |
bool H4Geom::init | ( | ) |
Initialize geometry with config file.
Definition at line 206 of file H4Geom.cc.
00207 { 00208 // if (gConfigParser->isDefined("Geometry::Period")) 00209 // geometry_ = H4Geom::GeomPeriod_t(gConfigParser-> 00210 // readIntOption("Geometry::Period")); 00211 // else 00212 // return false; 00213 return true; 00214 }
bool H4Geom::IsGeomPeriodDefined | ( | ) | const [private] |
bool H4Geom::IsGeomPeriodDefined | ( | ) | const [private] |
bool H4Geom::IsGeomPeriodDefined | ( | ) | const [private] |
Definition at line 698 of file H4Geom.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), geometry_, and Undef.
Referenced by getLeft(), getLower(), getRight(), getSMCrystalNumber(), getTower(), getTowerCrystalNumber(), getUpper(), and rightTower().
00698 { 00699 if (geometry_ == H4Geom::Undef) { 00700 std::cout << "Class H4Geom : geometry is not defined. You should call in" 00701 << " your program H4Geom::init (and fill the [Geometry] section" 00702 << " of your config file) or call H4Geom::SetGeomPeriod." 00703 << std::endl; 00704 return false; 00705 } 00706 return true; 00707 }
Definition at line 167 of file Geom.h.
References eta, getCrystalCoord(), and phi.
00168 { 00169 int eta; int phi; 00170 getCrystalCoord(eta,phi, numberInSM); 00171 if (phi > 19 || eta < 20 ) 00172 {return true; } 00173 else 00174 {return false; } 00175 };
Definition at line 166 of file Geom.h.
References eta, getCrystalCoord(), and phi.
00167 { 00168 int eta; int phi; 00169 getCrystalCoord(eta,phi, numberInSM); 00170 if (phi > 19 || eta < 20 ) 00171 {return true; } 00172 else 00173 {return false; } 00174 };
Tests if low voltage board is on the left size of the tower.
Readout scheme depends on that. the readout order for a "left-tower" is defined by:
* +--+--+--+--+--+ * | 4| 5|14|15|24| * +--+--+--+--+--+ * | 3| 6|13|16|23| * +--+--+--+--+--+ * | 2| 7|12|17|22| * +--+--+--+--+--+ * | 1| 8|11|18|21| * +--+--+--+--+--+ * | 0| 9|10|19|20| * +--+--+--+--+--+ *
Definition at line 688 of file H4Geom.cc.
References rightTower().
Referenced by getTowerCrystalNumber().
00689 { 00690 return !rightTower(tower); 00691 }
Returns lower neighbour of a crystal referenced by its coordinates.
New coordonates overwrite the old ones. No check is done to see if it corresponds to a real crystal. To be used with caution.
Definition at line 480 of file H4Geom.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00481 { 00482 if (phi < 0) 00483 std::cout << "H4Geom::mvDown: phi is too small " << phi << std::endl; 00484 phi--; 00485 }
Returns left neighbour of a crystal referenced by its coordinates.
New coordonates overwrite the old ones. No check is done to see if it corresponds to a real crystal. To be used with caution.
Definition at line 449 of file H4Geom.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and kCrystalsInEta.
00450 { 00451 if (eta >= kCrystalsInEta) 00452 std::cout << "H4Geom::mvLeft: eta is too large " << eta << std::endl; 00453 eta++; 00454 }
Returns right neighbour of a crystal referenced by its coordinates.
New coordonates overwrite the old ones. No check is done to see if it corresponds to a real crystal. To be used with caution.
Definition at line 459 of file H4Geom.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00460 { 00461 if (eta < 0) 00462 std::cout << "H4Geom::mvRight: eta is too small " << eta << std::endl; 00463 eta--; 00464 }
Returns upper neighbour of a crystal referenced by its coordinates.
New coordonates overwrite the old ones. No check is done to see if it corresponds to a real crystal. To be used with caution.
Definition at line 469 of file H4Geom.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and kCrystalsInPhi.
00470 { 00471 if (phi >= kCrystalsInPhi) 00472 std::cout << "H4Geom::mvUp: phi is too large " << phi << std::endl; 00473 phi++; 00474 }
Tests if low voltage board is on the right size of the tower.
Readout scheme depends on that. the readout order for a "right-tower" is defined by:
* +--+--+--+--+--+ * |20|19|10| 9| 0| * +--+--+--+--+--+ * |21|18|11| 8| 1| * +--+--+--+--+--+ * |22|17|12| 7| 2| * +--+--+--+--+--+ * |23|16|12| 6| 3| * +--+--+--+--+--+ * |24|15|14| 5| 4| * +--+--+--+--+--+ *
Definition at line 653 of file H4Geom.cc.
References Automn2004, geometry_, IsGeomPeriodDefined(), and kTowersInPhi.
Referenced by getSMCrystalNumber(), getTowerCrystalNumber(), and leftTower().
00654 { 00655 if (!IsGeomPeriodDefined()) abort(); 00656 if (geometry_ == H4Geom::Automn2004) { 00657 if ((tower - 1)/kTowersInPhi < 3 || 00658 ((tower - 1)/kTowersInPhi - 3)%4 >= 2) 00659 return false; 00660 else 00661 return true; 00662 } 00663 if ((tower>12 && tower<21) || (tower>28 && tower<37) || 00664 (tower>44 && tower<53) || (tower>60 && tower<69)) 00665 return true; 00666 else 00667 return false; 00668 }
static void H4Geom::SetGeomPeriod | ( | GeomPeriod_t | geometry | ) | [static] |
static void H4Geom::SetGeomPeriod | ( | GeomPeriod_t | geometry | ) | [static] |
void H4Geom::SetGeomPeriod | ( | GeomPeriod_t | geometry | ) | [static] |
const int H4Geom::crystalChannelMap [static, private] |
Initial value:
{ { 4, 5, 14, 15, 24}, { 3, 6, 13, 16, 23}, { 2, 7, 12, 17, 22}, { 1, 8, 11, 18, 21}, { 0, 9, 10, 19, 20} }
Definition at line 185 of file Geom.h.
Referenced by getTowerCrystalNumber().
const int H4Geom::crystalMap [static, private] |
Initial value:
{ 340, 255, 170, 85, 0, 1, 86, 171, 256, 341, 342, 257, 172, 87, 2, 3, 88, 173, 258, 343, 344, 259, 174, 89, 4 }
Definition at line 186 of file Geom.h.
Referenced by getSMCrystalNumber().
H4Geom::GeomPeriod_t H4Geom::geometry_ = H4Geom::Undef [static, private] |
Definition at line 188 of file Geom.h.
Referenced by getCrystalCoord(), GetGeomPeriod(), getLeft(), getLower(), getRight(), getSMCrystalFromCoord(), getSMCrystalNumber(), getTower(), getTowerCrystalNumber(), getUpper(), IsGeomPeriodDefined(), rightTower(), and SetGeomPeriod().
static const int H4Geom::WhichHalf [static, private] |