#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 noise Dummy File // cout << "writing Noise File" << endl; ofstream *out = new ofstream(); out->open("tpcNoise.data"); *out << 10 << endl; // NOISE int chip_ctr = 0; for ( int fec = 12; fec >= 0; fec-- ) { for ( int chip = 7; chip >= 0; chip-- ) { // branch A *out << chip_ctr << "\t" << 0 << "\t" << 13 << "\t" << 1 << "\t" << codeAddress(0, fec, chip, 0); *out << "\t" << 0.6+rand()/(float)RAND_MAX*0.2 << endl; chip_ctr++; // branch B if ( fec == 12 ) continue; *out << chip_ctr << "\t" << 0 << "\t" << 13 << "\t" << 1 << "\t" << codeAddress(1, fec, chip, 0); *out << "\t" << 0.6+rand()/(float)RAND_MAX*0.2 << endl; chip_ctr++; } } out->close(); delete out; out = 0; return 0; }