//------------------------------------------------------------------------------ // Chip geometry clas -- // (C) Piero Giubilato 2008-2010, Berkeley Lab -- //------------------------------------------------------------------------------ //______________________________________________________________________________ // {Trace} // [File name] "geom_Chip.cpp" // [Author] "Piero Giubilato" // [Version] "0.6" // [Modified by] "Piero Giubilato" // [Last revision] "31 Jan 2009" // [Language] "C++" // [Compiler] "Visual C++ 9.x" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "Chip geometry class" // [Key documentation] // "Root user's guide" // "Visual C++ Reference Help" // {Trace} //______________________________________________________________________________ // Standard libraries #include // Root components #include // Application components #include "geom_Chip.h" #include "global.h" // CINT Preprocessor class import definition //ClassImp(geom_Chip) //______________________________________________________________________________ geom_Chip::geom_Chip(): data_Layer() { // Stores all the information about the physical chip. // Note that the geometry rearrangement array has to be // matched with the readout scheme implemented into the // hardware side of the DAQ system. // Debug dbg_Print("geom_Chip::geom_Chip:()", DBG_LVL_ZERO); // Preset (self destroy if anything wrong) if (data_Preset()) { dbg_Print("geom_Chip::geom_Chip: failed to initialize object", DBG_LVL_PLAY); }; } //______________________________________________________________________________ geom_Chip::~geom_Chip () { // Debug dbg_Print("geom_Chip::~geom_Chip:()", DBG_LVL_ZERO); // Destructor: frees all heap allocated memory // Nothing to do, the only data into the heap will // be released by the automatic call to the parent\ // class destructor. } //______________________________________________________________________________ int geom_Chip::data_Preset() { // Preset chip data (data_Layer already preset to 1 dp) // Debug dbg_Print("geom_Chip::data_Preset:()", DBG_LVL_MAKE); // Geometry mapping this->dp_all_Range(0, 1); // Chip properties chip_col_Pitch = 10; chip_row_Pitch = 10; // Update object status this->isOk(true); this->isModified(false); // All Ok return 0; } //______________________________________________________________________________ UInt_t geom_Chip::col_Count() const { // Get sensor column count. return dp_col_Count(); } //______________________________________________________________________________ UInt_t geom_Chip::col_Count (UInt_t cols) { // Sets chip column count dp_col_Count(cols); // Ensures a linear geometry dp_all_Range(0, dp_Count() - 1); // Update chip status this->isModified(true); // Al Ok return col_Count(); } //______________________________________________________________________________ UInt_t geom_Chip::row_Count() const { // Get sensor row count. return dp_row_Count(); } //______________________________________________________________________________ UInt_t geom_Chip::row_Count (UInt_t rows) { // Sets chip row count dp_row_Count(rows); // Ensures a linear geometry dp_all_Range(0, dp_Count() - 1); // Update chip status this->isModified(true); // Al Ok return row_Count(); } //______________________________________________________________________________ Double_t geom_Chip::col_Pitch() const { // Get sensor pixel pitxh (X). return chip_col_Pitch; } //______________________________________________________________________________ Double_t geom_Chip::col_Pitch (Double_t pitch) { // Set sensor pixel pitch (X). chip_col_Pitch = pitch; // Update chip status this->isModified(true); // Al Ok return chip_col_Pitch; } //______________________________________________________________________________ Double_t geom_Chip::row_Pitch() const { // Get sensor pixel pitxh (Y). return chip_row_Pitch; } //______________________________________________________________________________ Double_t geom_Chip::row_Pitch (Double_t pitch) { // Set sensor pixel pitch (Y). chip_row_Pitch = pitch; // Update chip status this->isModified(true); // All Ok return chip_row_Pitch; } //______________________________________________________________________________ void geom_Chip::Dump(UInt_t level) const { // Dumps all the object data into std::out // Shows the header and the data members TString space(' ', level); std::cout << space.Data() << "*geom_Chip: " << (int*)this << "\n"; std::cout << space.Data() << "class_Ver: " << class_Ver << "\n"; std::cout << space.Data() << "chip_col_Pitch: " << chip_col_Pitch << "\n"; std::cout << space.Data() << "chip_row_Pitch: " << chip_row_Pitch << "\n"; // Shows the parent data_Layer::Dump(level + 2); } //______________________________________________________________________________ void geom_Chip::Streamer(TBuffer &b) { // Streams the data for the geom_Chip // Read if (b.IsReading()) { // Debug dbg_Print ("geom_Chip::Streamer: read call", DBG_LVL_FLOW) // Reads class version UShort_t class_ver_Read = 0; b >> class_ver_Read; // Checks version if (class_ver_Read != class_Ver) { dbg_Print ("geom_Chip::Streamer: read: version mismatch", DBG_LVL_WARN) dbg_Value(class_ver_Read, DBG_LVL_WARN); dbg_Value(class_Ver, DBG_LVL_WARN); } // Reads parent class data_Layer::Streamer(b); // Reads chip properties b >> chip_col_Pitch; b >> chip_row_Pitch; // Write } else { // Debug dbg_Print ("geom_Chip::Streamer: write call",DBG_LVL_FLOW) // Writes class version b << class_Ver; // Writes parent classes data_Layer::Streamer(b); // Writes chip properties b << chip_col_Pitch; b << chip_row_Pitch; } }