#include #include #include using namespace std; //======================================================================== int codeAddress(int Branch, int FEC, int chip, int channel) { return ((Branch&1)<<11) + ((FEC&0xf)<<7) + ((chip&0x7)<<4) + (channel&0xf); } //======================================================================== //======================================================================== int main( int argc, char** argv ) { // // Create Pedestal (fixed) Dummy File // cout << "writing pedestal File" << endl; ofstream *out = new ofstream(); out->open("tpcPedestals.data"); *out << "10" << endl; // PEDESTALS int chan_ctr = 0; for ( int fec = 12; fec >= 0; fec-- ) { for ( int chip = 7; chip >= 0; chip-- ) { for ( int chan = 15; chan >= 0; chan-- ) { // branch A *out << chan_ctr++ << "\t" << 1 << "\t" << 13 << "\t" << 1 << "\t" << codeAddress(0, fec, chip, chan) << "\t" << rand()/(float)RAND_MAX*80 << endl; // branch B if ( fec == 12 ) continue; *out << chan_ctr++ << "\t" << 1 << "\t" << 13 << "\t" << 1 << "\t" << codeAddress(1, fec, chip, chan) << "\t" << rand()/(float)RAND_MAX*80 << endl; } } } out->close(); delete out; out = 0; return 0; }