Index: fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_0.csv
===================================================================
--- fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_0.csv	(revision 13468)
+++ fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_0.csv	(revision 13468)
@@ -0,0 +1,310 @@
+### point-set of a single photon pulse template
+### template determined with pulse overlay at: Maximum
+### Slice's Amplitude determined by calculating the 
+### value of maximum propability of slice -> Amplitude1 
+### mean of slice -> Amplitude2 
+### median of slice -> Amplitude3 
+### for each slice
+### Pixel number (CHid): 0
+
+#time [slices],Amplitude1 [mV],Amplitude2 [mV],Amplitude3 [mV]
+1,-0.75,-0.252919,-0.25
+2,-1.25,-0.850716,-0.75
+3,-1.75,-1.00611,-1.25
+4,-0.75,-0.683416,-0.75
+5,-1.75,-0.655722,-0.75
+6,-1.25,-0.561429,-0.75
+7,-1.25,-0.842175,-1.25
+8,-1.25,-0.759503,-0.75
+9,-0.75,-1.02699,-1.25
+10,-0.75,-0.859039,-0.75
+11,-0.75,-0.40949,-0.75
+12,-0.75,-0.903041,-1.25
+13,-1.75,-1.09122,-1.25
+14,-1.25,-0.736193,-0.75
+15,-1.25,-0.794492,-0.75
+16,-0.75,-0.565585,-0.75
+17,-1.25,-0.847347,-0.75
+18,-1.75,-0.839417,-0.75
+19,-1.25,-1.07803,-1.25
+20,-1.25,-0.95661,-1.25
+21,-1.25,-0.538235,-0.75
+22,-0.75,-1.00807,-1.25
+23,-0.75,-1.18072,-1.25
+24,-0.75,-0.89046,-0.75
+25,-0.75,-0.857626,-0.75
+26,-1.25,-0.738831,-0.75
+27,-1.25,-0.972035,-0.75
+28,-1.75,-0.948551,-1.25
+29,-0.25,-1.15637,-1.25
+30,-1.25,-0.955893,-0.75
+31,-0.75,-0.451716,-0.75
+32,-0.75,-0.98637,-1.25
+33,-0.75,-1.20368,-1.25
+34,-0.75,-0.873786,-0.75
+35,-1.25,-0.893191,-0.75
+36,-0.75,-0.71125,-0.75
+37,-0.75,-1.00941,-1.25
+38,-0.75,-1.0216,-1.25
+39,-1.25,-1.23281,-1.25
+40,-1.25,-1.15416,-1.25
+41,-1.25,-0.659504,-0.75
+42,-0.75,-1.1265,-1.25
+43,-1.25,-1.3144,-1.25
+44,-0.75,-0.966932,-0.75
+45,-0.75,-0.886678,-0.75
+46,-1.25,-0.699144,-0.75
+47,-1.25,-0.940386,-0.75
+48,-1.75,-0.942896,-1.25
+49,-1.25,-1.15688,-1.25
+50,-0.75,-0.968231,-0.75
+51,-0.75,-0.577179,-0.75
+52,-0.75,-1.0349,-1.25
+53,-1.25,-1.18237,-1.25
+54,-0.25,-0.782072,-0.75
+55,-0.25,-0.636765,-0.75
+56,-0.75,-0.225455,-0.25
+57,-0.25,-0.0600195,-0.25
+58,0.75,0.577016,0.25
+59,1.25,1.23827,1.25
+60,2.25,2.47858,2.25
+61,3.75,4.30767,4.25
+62,6.25,5.1244,5.25
+63,6.75,6.08301,6.25
+64,8.75,8.14441,8.25
+65,8.75,9.04297,9.25
+66,10.75,9.96661,10.25
+67,10.75,10.1402,10.25
+68,10.75,10.4619,10.75
+69,10.75,10.3178,10.25
+70,10.75,10.2101,10.25
+71,11.75,11.5552,11.75
+72,9.75,9.77427,9.75
+73,9.75,9.41784,9.75
+74,9.25,9.46119,9.75
+75,8.75,9.14046,9.25
+76,8.75,8.89663,8.75
+77,8.25,8.23387,8.25
+78,8.25,8.10018,8.25
+79,7.75,6.99073,7.25
+80,7.25,7.0232,7.25
+81,7.25,7.26214,7.25
+82,6.75,6.47028,6.75
+83,6.75,6.06812,6.25
+84,6.75,6.31844,6.25
+85,6.75,6.28818,6.25
+86,5.75,6.23829,6.25
+87,6.25,5.81833,5.75
+88,5.25,5.74933,5.75
+89,6.25,5.27109,5.25
+90,5.75,5.31047,5.25
+91,6.25,5.74151,5.75
+92,4.75,5.02797,5.25
+93,4.25,4.66867,4.75
+94,4.75,4.93455,4.75
+95,4.75,4.80761,4.75
+96,4.25,4.84104,4.75
+97,4.75,4.429,4.25
+98,4.25,4.34382,4.25
+99,4.25,3.9397,3.75
+100,4.25,3.96778,3.75
+101,4.25,4.32866,4.25
+102,4.25,3.69062,3.75
+103,4.25,3.32151,3.25
+104,3.75,3.64006,3.25
+105,3.75,3.56479,3.25
+106,2.75,3.64016,3.25
+107,2.75,3.23652,3.25
+108,3.25,3.22278,2.75
+109,2.75,2.88518,2.75
+110,3.25,2.99428,2.75
+111,2.75,3.48544,3.25
+112,2.75,2.94337,2.75
+113,2.75,2.61538,2.25
+114,2.75,2.90295,2.75
+115,2.25,2.83283,2.25
+116,2.25,2.92376,2.75
+117,1.75,2.56711,2.25
+118,1.75,2.53566,2.25
+119,1.25,2.14853,1.75
+120,1.25,2.24864,1.75
+121,1.75,2.67179,2.25
+122,1.75,2.08203,1.75
+123,1.75,1.83258,1.25
+124,1.25,2.17449,1.75
+125,1.75,2.22405,1.75
+126,1.25,2.33095,1.75
+127,1.25,1.94742,1.25
+128,1.75,2.06831,1.75
+129,1.25,1.70168,1.25
+130,1.75,1.71626,1.25
+131,1.25,2.26095,1.75
+132,0.75,1.71174,1.25
+133,1.25,1.4061,1.25
+134,0.75,1.77567,1.25
+135,1.75,1.74338,1.25
+136,0.75,1.85216,1.25
+137,0.75,1.55272,0.75
+138,0.25,1.55971,0.75
+139,0.25,1.29004,0.75
+140,0.25,1.31405,0.75
+141,1.25,1.8527,1.25
+142,0.75,1.18823,0.75
+143,0.25,0.97959,0.25
+144,0.75,1.35525,0.75
+145,-0.25,1.42319,0.75
+146,0.25,1.57487,0.75
+147,1.25,1.25308,0.75
+148,0.25,1.24603,0.75
+149,-0.25,0.945556,0.25
+150,0.25,1.07205,0.25
+151,0.25,1.54404,0.75
+152,-0.25,1.0548,0.25
+153,0.25,0.790164,0.25
+154,-0.25,1.1292,0.25
+155,0.25,1.10926,0.25
+156,-0.25,1.22939,0.75
+157,0.25,0.881652,0.25
+158,-0.75,0.932848,0.25
+159,-0.75,0.636819,0.25
+160,-0.75,0.740398,0.25
+161,-0.75,1.24648,0.25
+162,-0.25,0.693472,0.25
+163,-0.25,0.472697,-0.25
+164,-0.75,0.842293,0.25
+165,0.25,0.875478,0.25
+166,-0.25,1.05601,0.25
+167,0.25,0.771127,0.25
+168,-0.25,0.746092,0.25
+169,-0.25,0.480807,-0.25
+170,-0.75,0.586476,0.25
+171,0.25,1.07284,0.25
+172,0.25,0.571177,0.25
+173,-0.25,0.265649,-0.25
+174,-0.25,0.608519,-0.25
+175,-0.25,0.622194,0.25
+176,0.25,0.760769,0.25
+177,0.25,0.409906,-0.25
+178,-0.75,0.49715,-0.25
+179,0.25,0.218258,-0.25
+180,-0.25,0.375526,-0.25
+181,0.25,0.860407,0.25
+182,-1.25,0.25911,-0.25
+183,-0.75,0.102415,-0.25
+184,-0.25,0.43821,-0.25
+185,-0.75,0.427693,-0.25
+186,-0.25,0.629736,-0.25
+187,-0.25,0.317243,-0.25
+188,0.25,0.399944,-0.25
+189,-1.25,0.133503,-0.25
+190,-0.75,0.305938,-0.25
+191,-0.25,0.738,0.25
+192,0.25,0.220317,-0.25
+193,-0.75,0.0219349,-0.75
+194,0.25,0.350581,-0.25
+195,-0.75,0.419889,-0.25
+196,-0.25,0.534452,-0.25
+197,-0.75,0.269403,-0.25
+198,-0.75,0.319469,-0.25
+199,-0.75,-0.024563,-0.75
+200,-0.25,0.184888,-0.25
+201,0.25,0.569757,-0.25
+202,-1.75,0.153775,-0.25
+203,-0.25,-0.0954829,-0.75
+204,-1.25,0.22822,-0.25
+205,-0.25,0.279209,-0.25
+206,-1.25,0.418248,-0.25
+207,-0.25,0.181246,-0.25
+208,-0.25,0.199741,-0.25
+209,-0.75,0.0262723,-0.75
+210,-0.25,0.132606,-0.25
+211,-0.25,0.617219,-0.25
+212,-0.75,0.132807,-0.25
+213,-0.25,-0.102862,-0.75
+214,-0.25,0.248643,-0.25
+215,-1.25,0.27903,-0.25
+216,-0.25,0.456469,-0.25
+217,-0.75,0.0760717,-0.75
+218,-0.75,0.137221,-0.75
+219,-1.25,-0.0353047,-0.75
+220,-0.75,0.0839286,-0.75
+221,-0.25,0.620437,-0.25
+222,-0.25,0.0144718,-0.75
+223,-0.75,-0.114537,-0.75
+224,-0.25,0.228723,-0.25
+225,-1.25,0.296736,-0.25
+226,-0.25,0.43596,-0.25
+227,-0.25,0.174543,-0.25
+228,-1.25,0.203992,-0.25
+229,-0.75,-0.0442547,-0.75
+230,-0.75,0.116044,-0.25
+231,-0.25,0.520039,-0.25
+232,-0.75,-0.0222222,-0.75
+233,-1.25,-0.219976,-0.75
+234,-0.75,0.0978261,-0.75
+235,-0.75,0.256088,-0.25
+236,-0.75,0.397997,-0.25
+237,-1.25,0.154443,-0.25
+238,-0.75,0.15974,-0.75
+239,-0.75,-0.0799057,-0.75
+240,-0.25,0.0105877,-0.75
+241,-0.25,0.347487,-0.25
+242,-0.25,-0.132379,-0.75
+243,-1.25,-0.318919,-0.75
+244,-0.25,0.0123986,-0.75
+245,-1.75,0.0330616,-0.75
+246,-1.25,0.243572,-0.25
+247,-0.25,0.0175726,-0.25
+248,-1.25,0.0964419,-0.75
+249,-0.75,-0.151341,-0.75
+250,-0.75,0.0227273,-0.75
+251,-0.75,0.492498,-0.25
+252,-0.25,-0.046627,-0.75
+253,-0.75,-0.164401,-0.75
+254,-0.75,0.0560606,-0.75
+255,-0.75,0.133282,-0.75
+256,0.25,0.343071,-0.25
+257,-0.75,0.0340549,-0.75
+258,-0.75,0.0329989,-0.75
+259,-0.25,-0.20685,-0.75
+260,-0.75,-0.0607375,-0.75
+261,-0.75,0.354235,-0.25
+262,-0.75,-0.17713,-0.75
+263,-1.25,-0.325085,-0.75
+264,-1.25,-0.0697941,-0.75
+265,-0.75,0.0421929,-0.75
+266,-0.75,0.284183,-0.25
+267,-1.25,-0.000891795,-0.75
+268,-0.25,0.0935252,-0.75
+269,-0.75,-0.248175,-0.75
+270,-1.75,-0.143696,-0.75
+271,0.25,0.329078,-0.25
+272,-1.25,-0.125796,-0.75
+273,-0.75,-0.377771,-0.75
+274,-1.25,-0.113158,-0.75
+275,-0.75,-0.0130174,-0.75
+276,-0.75,0.199796,-0.25
+277,-1.25,-0.0868347,-0.75
+278,-0.75,-0.0695804,-0.75
+279,-0.25,-0.420322,-0.75
+280,-0.75,-0.25,-0.75
+281,-0.25,0.101032,-0.25
+282,-0.25,-0.385747,-0.75
+283,-0.75,-0.51489,-0.75
+284,-0.75,-0.196792,-0.75
+285,-0.75,-0.195946,-0.75
+286,-0.25,-0.0241935,-0.25
+287,-0.75,-0.298203,-0.75
+288,-1.25,-0.24,-0.75
+289,-0.75,-0.431424,-0.75
+290,-1.25,-0.320804,-0.75
+291,-0.25,0.2125,-0.25
+292,-0.25,-0.157649,-0.75
+293,-1.25,-0.409266,-0.75
+294,-1.75,-0.166985,-0.75
+295,-1.25,-0.180255,-0.75
+296,-0.25,0.0873253,-0.25
+297,-0.75,-0.213542,-0.75
+298,-0.75,-0.27416,-0.75
+299,-0.25,-0.564534,-0.75
+300,-0.25,-0.395374,-0.75
Index: fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_1.csv
===================================================================
--- fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_1.csv	(revision 13468)
+++ fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_1.csv	(revision 13468)
@@ -0,0 +1,310 @@
+### point-set of a single photon pulse template
+### template determined with pulse overlay at: Maximum
+### Slice's Amplitude determined by calculating the 
+### value of maximum propability of slice -> Amplitude1 
+### mean of slice -> Amplitude2 
+### median of slice -> Amplitude3 
+### for each slice
+### Pixel number (CHid): 1
+
+time [slices],Amplitude1 [mV],Amplitude2 [mV],Amplitude3 [mV]
+1,-0.25,-0.11869,-0.25
+2,-0.75,-0.614257,-0.75
+3,-0.75,-0.90797,-0.75
+4,-0.75,-0.520157,-0.75
+5,-0.25,-0.520451,-0.75
+6,-0.25,-0.393927,-0.75
+7,0.25,-0.562188,-0.75
+8,-0.25,-0.575069,-0.75
+9,-0.75,-0.824779,-0.75
+10,-1.25,-0.661299,-0.75
+11,-0.75,-0.156977,-0.25
+12,-0.25,-0.652045,-0.75
+13,-0.25,-0.932953,-0.75
+14,-0.75,-0.523746,-0.75
+15,-0.75,-0.592218,-0.75
+16,-0.75,-0.412599,-0.25
+17,-0.25,-0.641791,-0.75
+18,-1.25,-0.718553,-0.75
+19,-0.75,-0.996845,-1.25
+20,-1.25,-0.800574,-0.75
+21,-0.25,-0.301057,-0.25
+22,-0.75,-0.797385,-0.75
+23,-0.75,-0.964286,-0.75
+24,-0.25,-0.608974,-0.75
+25,-0.25,-0.595171,-0.75
+26,-0.75,-0.448075,-0.75
+27,-0.25,-0.646298,-0.75
+28,-0.25,-0.681624,-0.75
+29,-1.25,-0.883938,-0.75
+30,-0.25,-0.66206,-0.75
+31,-0.75,-0.315809,-0.25
+32,-0.75,-0.771351,-0.75
+33,-0.25,-1.12288,-1.25
+34,0.25,-0.75098,-0.75
+35,-0.75,-0.723723,-0.75
+36,-0.75,-0.582203,-0.75
+37,-0.75,-0.780266,-0.75
+38,-0.75,-0.779947,-0.75
+39,-1.25,-1.00168,-0.75
+40,-0.75,-0.883444,-0.75
+41,-0.75,-0.412577,-0.25
+42,-0.75,-0.858357,-0.75
+43,-0.75,-1.10541,-1.25
+44,-0.75,-0.728291,-0.75
+45,-0.25,-0.676089,-0.75
+46,-1.25,-0.559677,-0.75
+47,-0.75,-0.73036,-0.75
+48,-0.25,-0.680727,-0.75
+49,-0.25,-0.95023,-0.75
+50,-0.25,-0.706076,-0.75
+51,-0.25,-0.223933,-0.25
+52,-0.75,-0.687163,-0.75
+53,-0.75,-0.89527,-0.75
+54,-0.75,-0.435193,-0.75
+55,-0.75,-0.325664,-0.25
+56,-0.25,0.0585714,-0.25
+57,-0.25,0.251097,0.25
+58,0.75,0.860485,0.75
+59,1.25,1.4176,1.25
+60,2.75,2.68613,2.75
+61,4.75,4.48978,4.25
+62,4.75,5.36651,5.25
+63,7.25,6.22077,6.25
+64,8.25,8.37425,8.25
+65,9.75,9.23537,9.25
+66,10.25,10.1667,10.25
+67,10.25,10.4437,10.75
+68,10.75,10.6168,10.75
+69,10.75,10.4488,10.75
+70,10.75,10.33,10.25
+71,11.25,11.6247,11.75
+72,10.75,9.93358,10.25
+73,10.25,9.50989,9.75
+74,10.25,9.60643,9.75
+75,9.75,9.33398,9.25
+76,8.75,9.13602,9.25
+77,8.25,8.52079,8.75
+78,8.25,8.36245,8.25
+79,7.75,7.25328,7.25
+80,7.25,7.24122,7.25
+81,7.75,7.43124,7.75
+82,7.25,6.79729,6.75
+83,6.25,6.27161,6.25
+84,6.75,6.58422,6.75
+85,6.75,6.46728,6.75
+86,7.25,6.46126,6.75
+87,7.25,6.0799,6.25
+88,6.25,5.97899,6.25
+89,5.75,5.53555,5.75
+90,5.75,5.52118,5.75
+91,6.25,5.9332,5.75
+92,5.25,5.28376,5.25
+93,4.25,4.8121,4.75
+94,4.75,5.18635,5.25
+95,4.75,4.96788,4.75
+96,5.75,5.02618,4.75
+97,4.75,4.67419,4.75
+98,4.75,4.52832,4.25
+99,4.75,4.14284,4.25
+100,4.25,4.13711,4.25
+101,4.25,4.58617,4.25
+102,3.75,3.9689,3.75
+103,3.75,3.52381,3.75
+104,3.25,3.89272,3.75
+105,3.75,3.84564,3.75
+106,4.25,3.90984,3.75
+107,3.75,3.55943,3.25
+108,2.75,3.49682,3.25
+109,3.25,3.07489,2.75
+110,2.25,3.22581,2.75
+111,3.25,3.68307,3.25
+112,2.75,3.13507,2.75
+113,2.25,2.67782,2.25
+114,2.75,3.10234,2.75
+115,2.75,3.02887,2.75
+116,2.75,3.09982,2.75
+117,1.75,2.84035,2.25
+118,1.75,2.77087,2.25
+119,2.75,2.4934,2.25
+120,2.75,2.45545,2.25
+121,2.25,2.95518,2.25
+122,2.25,2.38491,2.25
+123,2.25,2.01716,1.75
+124,2.25,2.41808,2.25
+125,2.25,2.40682,2.25
+126,1.75,2.5132,2.25
+127,2.25,2.13538,1.75
+128,1.75,2.18022,1.75
+129,1.75,1.74621,1.25
+130,1.25,1.85568,1.25
+131,1.75,2.36963,1.75
+132,1.75,1.87056,1.25
+133,0.75,1.52308,1.25
+134,1.25,1.94906,1.25
+135,1.75,1.9584,1.25
+136,1.75,2.02487,1.25
+137,1.25,1.79127,1.25
+138,0.75,1.8096,1.25
+139,0.25,1.41439,0.75
+140,0.75,1.50687,1.25
+141,0.75,2.08621,1.25
+142,1.25,1.44375,0.75
+143,0.25,1.21489,0.75
+144,0.25,1.48104,0.75
+145,0.25,1.53072,1.25
+146,0.25,1.64049,1.25
+147,0.25,1.35533,0.75
+148,0.25,1.36055,0.75
+149,0.75,1.00374,0.75
+150,0.75,1.19832,0.75
+151,0.75,1.66873,1.25
+152,0.75,1.18693,0.75
+153,0.75,0.898871,0.75
+154,0.25,1.19312,0.75
+155,-0.25,1.16687,0.75
+156,0.25,1.3254,0.75
+157,1.25,1.05954,0.75
+158,0.25,1.03446,0.25
+159,0.25,0.765843,0.25
+160,-0.25,0.938332,0.25
+161,0.75,1.38726,0.75
+162,-0.25,0.899968,0.25
+163,0.25,0.619845,0.25
+164,0.75,0.992561,0.25
+165,0.25,1.03729,0.25
+166,0.25,1.21549,0.25
+167,0.25,0.890984,0.25
+168,0.25,0.890212,0.25
+169,-0.25,0.622667,0.25
+170,0.25,0.742282,0.25
+171,0.25,1.21799,0.75
+172,0.25,0.716079,0.25
+173,-0.25,0.423958,-0.25
+174,-0.25,0.764746,0.25
+175,0.25,0.747937,0.25
+176,-0.25,0.905579,0.25
+177,-0.25,0.624126,0.25
+178,-0.75,0.710867,0.25
+179,-0.25,0.409559,-0.25
+180,-0.75,0.572731,0.25
+181,0.25,1.05581,0.25
+182,-0.75,0.475127,0.25
+183,-0.25,0.301028,-0.25
+184,-0.25,0.579063,0.25
+185,0.25,0.565613,0.25
+186,-0.25,0.750373,0.25
+187,0.25,0.490559,0.25
+188,-0.25,0.492413,-0.25
+189,-0.25,0.0792308,-0.25
+190,0.25,0.311335,-0.25
+191,-0.25,0.776827,0.25
+192,-0.25,0.282651,-0.25
+193,0.75,0.158074,-0.25
+194,0.25,0.460987,-0.25
+195,0.25,0.509824,0.25
+196,-0.25,0.594507,-0.25
+197,0.25,0.485078,0.25
+198,-0.75,0.437142,-0.25
+199,-0.25,0.165833,-0.25
+200,-0.25,0.272538,-0.25
+201,0.25,0.745405,0.25
+202,-0.75,0.299747,-0.25
+203,-1.25,0.142888,-0.25
+204,-0.75,0.464043,-0.25
+205,-0.75,0.472079,-0.25
+206,-0.75,0.618421,0.25
+207,-0.75,0.464844,0.25
+208,-0.75,0.353299,-0.25
+209,-0.75,0.102423,-0.25
+210,-0.25,0.207257,-0.25
+211,-0.25,0.700893,0.25
+212,-0.25,0.206109,-0.25
+213,-0.75,-0.0243119,-0.25
+214,-0.75,0.316237,-0.25
+215,-0.25,0.292326,-0.25
+216,-0.75,0.36784,-0.25
+217,-0.75,0.225379,-0.25
+218,-0.25,0.196395,-0.25
+219,-0.25,-0.00289575,-0.25
+220,-0.75,0.215601,-0.25
+221,0.25,0.671769,0.25
+222,-0.75,0.222468,-0.25
+223,-0.25,0.00520317,-0.25
+224,0.25,0.374502,-0.25
+225,-0.25,0.321214,-0.25
+226,-0.25,0.507852,-0.25
+227,-0.75,0.359568,-0.25
+228,-0.75,0.388287,-0.25
+229,-0.75,0.0378788,-0.75
+230,0.25,0.345541,-0.25
+231,0.25,0.779162,0.25
+232,-0.75,0.154891,-0.25
+233,-0.75,0.0426293,-0.75
+234,-0.75,0.294653,-0.25
+235,-0.75,0.343333,-0.25
+236,-0.75,0.551578,-0.25
+237,-0.25,0.313429,-0.25
+238,-0.25,0.341065,-0.25
+239,0.25,-0.0413247,-0.25
+240,-0.25,0.173439,-0.25
+241,-0.25,0.538076,-0.25
+242,-0.25,0.105072,-0.25
+243,-0.25,-0.0910758,-0.75
+244,-0.75,0.291667,-0.25
+245,0.25,0.238272,-0.25
+246,-0.25,0.300248,-0.25
+247,-0.75,0.187975,-0.25
+248,-1.25,0.0869565,-0.25
+249,-0.25,-0.154575,-0.75
+250,-1.75,0.0183727,-0.25
+251,-0.25,0.512187,-0.25
+252,-0.25,0.15721,-0.25
+253,-0.25,-0.247954,-0.75
+254,-1.25,0.288934,-0.25
+255,-0.75,0.196575,-0.25
+256,-0.25,0.337535,-0.25
+257,-0.75,0.0258865,-0.25
+258,-1.25,0.0888017,-0.25
+259,-0.75,-0.27193,-0.75
+260,-0.75,-0.00953079,-0.25
+261,-0.75,0.502555,-0.25
+262,-0.75,0.0966667,-0.25
+263,-0.25,-0.0227964,-0.25
+264,0.25,0.279367,-0.25
+265,0.25,0.311927,-0.25
+266,-0.25,0.312888,-0.25
+267,0.25,0.245981,-0.25
+268,-0.25,0.149518,-0.25
+269,-0.25,-0.213355,-0.75
+270,-0.25,-0.0373754,-0.5
+271,-0.75,0.299085,-0.25
+272,-1.25,-0.135077,-0.75
+273,-0.75,-0.325,-0.75
+274,-0.75,0.108131,-0.25
+275,-1.25,0.0021815,-0.75
+276,-0.75,0.147869,-0.25
+277,-0.75,0.0628391,-0.25
+278,-1.25,-0.195572,-0.75
+279,-0.75,-0.319811,-0.75
+280,-0.75,-0.24031,-0.75
+281,-0.25,0.340467,-0.25
+282,0.25,-0.232143,-0.75
+283,-0.75,-0.384615,-0.75
+284,-0.75,0.0901222,-0.25
+285,-0.75,0.0326087,-0.25
+286,-0.75,0.0889474,-0.25
+287,-0.25,-0.137473,-0.75
+288,-0.75,-0.118363,-0.75
+289,-0.25,-0.345455,-0.75
+290,-0.25,-0.210227,-0.75
+291,-1.25,0.221198,-0.25
+292,0.25,-0.177896,-0.75
+293,0.25,-0.410147,-0.75
+294,-1.25,-0.00615764,-0.25
+295,0.25,0.0252525,-0.25
+296,-1.25,0.153101,-0.25
+297,-1.25,0.0431034,-0.25
+298,-1.25,-0.150815,-0.75
+299,-1.75,-0.308172,-0.75
+300,-1.25,-0.263889,-0.75
Index: fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_AllPixel.csv
===================================================================
--- fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_AllPixel.csv	(revision 13468)
+++ fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/PulseTemplate_PointSet_AllPixel.csv	(revision 13468)
@@ -0,0 +1,308 @@
+### point-set of a single photon pulse template
+### template determined with pulse overlay at: Maximumof all Pixels### Slice's Amplitude determined by calculating the 
+### value of maximum propability of slice -> Amplitude1 
+### mean of slice -> Amplitude2 
+### median of slice -> Amplitude3 
+### for each slice
+
+time [slices],Amplitude1 [mV],Amplitude2 [mV],Amplitude3 [mV]
+1,-0.25,-0.11869,-0.25
+2,-0.75,-0.614257,-0.75
+3,-0.75,-0.90797,-0.75
+4,-0.75,-0.520157,-0.75
+5,-0.25,-0.520451,-0.75
+6,-0.25,-0.393927,-0.75
+7,0.25,-0.562188,-0.75
+8,-0.25,-0.575069,-0.75
+9,-0.75,-0.824779,-0.75
+10,-1.25,-0.661299,-0.75
+11,-0.75,-0.156977,-0.25
+12,-0.25,-0.652045,-0.75
+13,-0.25,-0.932953,-0.75
+14,-0.75,-0.523746,-0.75
+15,-0.75,-0.592218,-0.75
+16,-0.75,-0.412599,-0.25
+17,-0.25,-0.641791,-0.75
+18,-1.25,-0.718553,-0.75
+19,-0.75,-0.996845,-1.25
+20,-1.25,-0.800574,-0.75
+21,-0.25,-0.301057,-0.25
+22,-0.75,-0.797385,-0.75
+23,-0.75,-0.964286,-0.75
+24,-0.25,-0.608974,-0.75
+25,-0.25,-0.595171,-0.75
+26,-0.75,-0.448075,-0.75
+27,-0.25,-0.646298,-0.75
+28,-0.25,-0.681624,-0.75
+29,-1.25,-0.883938,-0.75
+30,-0.25,-0.66206,-0.75
+31,-0.75,-0.315809,-0.25
+32,-0.75,-0.771351,-0.75
+33,-0.25,-1.12288,-1.25
+34,0.25,-0.75098,-0.75
+35,-0.75,-0.723723,-0.75
+36,-0.75,-0.582203,-0.75
+37,-0.75,-0.780266,-0.75
+38,-0.75,-0.779947,-0.75
+39,-1.25,-1.00168,-0.75
+40,-0.75,-0.883444,-0.75
+41,-0.75,-0.412577,-0.25
+42,-0.75,-0.858357,-0.75
+43,-0.75,-1.10541,-1.25
+44,-0.75,-0.728291,-0.75
+45,-0.25,-0.676089,-0.75
+46,-1.25,-0.559677,-0.75
+47,-0.75,-0.73036,-0.75
+48,-0.25,-0.680727,-0.75
+49,-0.25,-0.95023,-0.75
+50,-0.25,-0.706076,-0.75
+51,-0.25,-0.223933,-0.25
+52,-0.75,-0.687163,-0.75
+53,-0.75,-0.89527,-0.75
+54,-0.75,-0.435193,-0.75
+55,-0.75,-0.325664,-0.25
+56,-0.25,0.0585714,-0.25
+57,-0.25,0.251097,0.25
+58,0.75,0.860485,0.75
+59,1.25,1.4176,1.25
+60,2.75,2.68613,2.75
+61,4.75,4.48978,4.25
+62,4.75,5.36651,5.25
+63,7.25,6.22077,6.25
+64,8.25,8.37425,8.25
+65,9.75,9.23537,9.25
+66,10.25,10.1667,10.25
+67,10.25,10.4437,10.75
+68,10.75,10.6168,10.75
+69,10.75,10.4488,10.75
+70,10.75,10.33,10.25
+71,11.25,11.6247,11.75
+72,10.75,9.93358,10.25
+73,10.25,9.50989,9.75
+74,10.25,9.60643,9.75
+75,9.75,9.33398,9.25
+76,8.75,9.13602,9.25
+77,8.25,8.52079,8.75
+78,8.25,8.36245,8.25
+79,7.75,7.25328,7.25
+80,7.25,7.24122,7.25
+81,7.75,7.43124,7.75
+82,7.25,6.79729,6.75
+83,6.25,6.27161,6.25
+84,6.75,6.58422,6.75
+85,6.75,6.46728,6.75
+86,7.25,6.46126,6.75
+87,7.25,6.0799,6.25
+88,6.25,5.97899,6.25
+89,5.75,5.53555,5.75
+90,5.75,5.52118,5.75
+91,6.25,5.9332,5.75
+92,5.25,5.28376,5.25
+93,4.25,4.8121,4.75
+94,4.75,5.18635,5.25
+95,4.75,4.96788,4.75
+96,5.75,5.02618,4.75
+97,4.75,4.67419,4.75
+98,4.75,4.52832,4.25
+99,4.75,4.14284,4.25
+100,4.25,4.13711,4.25
+101,4.25,4.58617,4.25
+102,3.75,3.9689,3.75
+103,3.75,3.52381,3.75
+104,3.25,3.89272,3.75
+105,3.75,3.84564,3.75
+106,4.25,3.90984,3.75
+107,3.75,3.55943,3.25
+108,2.75,3.49682,3.25
+109,3.25,3.07489,2.75
+110,2.25,3.22581,2.75
+111,3.25,3.68307,3.25
+112,2.75,3.13507,2.75
+113,2.25,2.67782,2.25
+114,2.75,3.10234,2.75
+115,2.75,3.02887,2.75
+116,2.75,3.09982,2.75
+117,1.75,2.84035,2.25
+118,1.75,2.77087,2.25
+119,2.75,2.4934,2.25
+120,2.75,2.45545,2.25
+121,2.25,2.95518,2.25
+122,2.25,2.38491,2.25
+123,2.25,2.01716,1.75
+124,2.25,2.41808,2.25
+125,2.25,2.40682,2.25
+126,1.75,2.5132,2.25
+127,2.25,2.13538,1.75
+128,1.75,2.18022,1.75
+129,1.75,1.74621,1.25
+130,1.25,1.85568,1.25
+131,1.75,2.36963,1.75
+132,1.75,1.87056,1.25
+133,0.75,1.52308,1.25
+134,1.25,1.94906,1.25
+135,1.75,1.9584,1.25
+136,1.75,2.02487,1.25
+137,1.25,1.79127,1.25
+138,0.75,1.8096,1.25
+139,0.25,1.41439,0.75
+140,0.75,1.50687,1.25
+141,0.75,2.08621,1.25
+142,1.25,1.44375,0.75
+143,0.25,1.21489,0.75
+144,0.25,1.48104,0.75
+145,0.25,1.53072,1.25
+146,0.25,1.64049,1.25
+147,0.25,1.35533,0.75
+148,0.25,1.36055,0.75
+149,0.75,1.00374,0.75
+150,0.75,1.19832,0.75
+151,0.75,1.66873,1.25
+152,0.75,1.18693,0.75
+153,0.75,0.898871,0.75
+154,0.25,1.19312,0.75
+155,-0.25,1.16687,0.75
+156,0.25,1.3254,0.75
+157,1.25,1.05954,0.75
+158,0.25,1.03446,0.25
+159,0.25,0.765843,0.25
+160,-0.25,0.938332,0.25
+161,0.75,1.38726,0.75
+162,-0.25,0.899968,0.25
+163,0.25,0.619845,0.25
+164,0.75,0.992561,0.25
+165,0.25,1.03729,0.25
+166,0.25,1.21549,0.25
+167,0.25,0.890984,0.25
+168,0.25,0.890212,0.25
+169,-0.25,0.622667,0.25
+170,0.25,0.742282,0.25
+171,0.25,1.21799,0.75
+172,0.25,0.716079,0.25
+173,-0.25,0.423958,-0.25
+174,-0.25,0.764746,0.25
+175,0.25,0.747937,0.25
+176,-0.25,0.905579,0.25
+177,-0.25,0.624126,0.25
+178,-0.75,0.710867,0.25
+179,-0.25,0.409559,-0.25
+180,-0.75,0.572731,0.25
+181,0.25,1.05581,0.25
+182,-0.75,0.475127,0.25
+183,-0.25,0.301028,-0.25
+184,-0.25,0.579063,0.25
+185,0.25,0.565613,0.25
+186,-0.25,0.750373,0.25
+187,0.25,0.490559,0.25
+188,-0.25,0.492413,-0.25
+189,-0.25,0.0792308,-0.25
+190,0.25,0.311335,-0.25
+191,-0.25,0.776827,0.25
+192,-0.25,0.282651,-0.25
+193,0.75,0.158074,-0.25
+194,0.25,0.460987,-0.25
+195,0.25,0.509824,0.25
+196,-0.25,0.594507,-0.25
+197,0.25,0.485078,0.25
+198,-0.75,0.437142,-0.25
+199,-0.25,0.165833,-0.25
+200,-0.25,0.272538,-0.25
+201,0.25,0.745405,0.25
+202,-0.75,0.299747,-0.25
+203,-1.25,0.142888,-0.25
+204,-0.75,0.464043,-0.25
+205,-0.75,0.472079,-0.25
+206,-0.75,0.618421,0.25
+207,-0.75,0.464844,0.25
+208,-0.75,0.353299,-0.25
+209,-0.75,0.102423,-0.25
+210,-0.25,0.207257,-0.25
+211,-0.25,0.700893,0.25
+212,-0.25,0.206109,-0.25
+213,-0.75,-0.0243119,-0.25
+214,-0.75,0.316237,-0.25
+215,-0.25,0.292326,-0.25
+216,-0.75,0.36784,-0.25
+217,-0.75,0.225379,-0.25
+218,-0.25,0.196395,-0.25
+219,-0.25,-0.00289575,-0.25
+220,-0.75,0.215601,-0.25
+221,0.25,0.671769,0.25
+222,-0.75,0.222468,-0.25
+223,-0.25,0.00520317,-0.25
+224,0.25,0.374502,-0.25
+225,-0.25,0.321214,-0.25
+226,-0.25,0.507852,-0.25
+227,-0.75,0.359568,-0.25
+228,-0.75,0.388287,-0.25
+229,-0.75,0.0378788,-0.75
+230,0.25,0.345541,-0.25
+231,0.25,0.779162,0.25
+232,-0.75,0.154891,-0.25
+233,-0.75,0.0426293,-0.75
+234,-0.75,0.294653,-0.25
+235,-0.75,0.343333,-0.25
+236,-0.75,0.551578,-0.25
+237,-0.25,0.313429,-0.25
+238,-0.25,0.341065,-0.25
+239,0.25,-0.0413247,-0.25
+240,-0.25,0.173439,-0.25
+241,-0.25,0.538076,-0.25
+242,-0.25,0.105072,-0.25
+243,-0.25,-0.0910758,-0.75
+244,-0.75,0.291667,-0.25
+245,0.25,0.238272,-0.25
+246,-0.25,0.300248,-0.25
+247,-0.75,0.187975,-0.25
+248,-1.25,0.0869565,-0.25
+249,-0.25,-0.154575,-0.75
+250,-1.75,0.0183727,-0.25
+251,-0.25,0.512187,-0.25
+252,-0.25,0.15721,-0.25
+253,-0.25,-0.247954,-0.75
+254,-1.25,0.288934,-0.25
+255,-0.75,0.196575,-0.25
+256,-0.25,0.337535,-0.25
+257,-0.75,0.0258865,-0.25
+258,-1.25,0.0888017,-0.25
+259,-0.75,-0.27193,-0.75
+260,-0.75,-0.00953079,-0.25
+261,-0.75,0.502555,-0.25
+262,-0.75,0.0966667,-0.25
+263,-0.25,-0.0227964,-0.25
+264,0.25,0.279367,-0.25
+265,0.25,0.311927,-0.25
+266,-0.25,0.312888,-0.25
+267,0.25,0.245981,-0.25
+268,-0.25,0.149518,-0.25
+269,-0.25,-0.213355,-0.75
+270,-0.25,-0.0373754,-0.5
+271,-0.75,0.299085,-0.25
+272,-1.25,-0.135077,-0.75
+273,-0.75,-0.325,-0.75
+274,-0.75,0.108131,-0.25
+275,-1.25,0.0021815,-0.75
+276,-0.75,0.147869,-0.25
+277,-0.75,0.0628391,-0.25
+278,-1.25,-0.195572,-0.75
+279,-0.75,-0.319811,-0.75
+280,-0.75,-0.24031,-0.75
+281,-0.25,0.340467,-0.25
+282,0.25,-0.232143,-0.75
+283,-0.75,-0.384615,-0.75
+284,-0.75,0.0901222,-0.25
+285,-0.75,0.0326087,-0.25
+286,-0.75,0.0889474,-0.25
+287,-0.25,-0.137473,-0.75
+288,-0.75,-0.118363,-0.75
+289,-0.25,-0.345455,-0.75
+290,-0.25,-0.210227,-0.75
+291,-1.25,0.221198,-0.25
+292,0.25,-0.177896,-0.75
+293,0.25,-0.410147,-0.75
+294,-1.25,-0.00615764,-0.25
+295,0.25,0.0252525,-0.25
+296,-1.25,0.153101,-0.25
+297,-1.25,0.0431034,-0.25
+298,-1.25,-0.150815,-0.75
+299,-1.75,-0.308172,-0.75
+300,-1.25,-0.263889,-0.75
Index: fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/gen_TH1D.py
===================================================================
--- fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/gen_TH1D.py	(revision 13468)
+++ fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/gen_TH1D.py	(revision 13468)
@@ -0,0 +1,341 @@
+#!/usr/bin/python -tt
+#
+# Dominik Neise, Werner Lustermann
+# TU Dortmund, ETH Zurich
+#
+import numpy as np
+import sys
+from ROOT import *
+
+class SignalGenerator(object):
+    """ Signal Generator
+        generates signals for testing several helper classes like:
+            * fir filters
+            * signal extractors
+    """
+    
+    def __init__(self, option_str = 'len 100 noise 3', name = 'SignalGenerator'):
+        """ initialize the generator
+            sets default signal to generate
+        """
+        self.__module__ = 'generator'
+        self.option_str = option_str.lower()
+        self.options = make_options_from_str(option_str)
+        self.parse_options()
+        self.name = name
+        
+    def parse_options(self):
+        o = self.options #shortcut
+        if 'len' in o:
+            self.npoints = int(o['len'][0])
+        else: 
+            self.npoints = 100
+        if 'noise' in o:
+            self.sigma = float(o['noise'][0])
+        else:
+            self.sigma = 1
+        if 'bsl' in o:
+            self.bsl = float(o['bsl'][0])
+        else:
+            self.bsl = -0.5
+        
+        if 'step' in o:
+            self.step_height = float(o['step'][0])
+            self.step_start = int(o['step'][1])
+            self.step_stop = int(o['step'][2])
+
+        if 'triangle' in o:
+            self.pulses = []
+            # append 1st pulse to list of pulses
+            self.pulses.append( ( float(o['triangle'][0]) , float(o['triangle'][1]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+            number_of_pulses_after_1st = (len(o['triangle'])-4)/2
+            for i in range(number_of_pulses_after_1st):
+                self.pulses.append( ( float(o['triangle'][2*i+4]) , float(o['triangle'][2*i+5]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+
+        if 'spike' in o:
+            self.spikes = []
+            for i in range(len(o['spike'])/2):
+                self.spikes.append( ( int(o['spike'][2*i]), float(o['spike'][2*i+1]) ) )
+
+    def __call__(self, option_str = ''):
+        if option_str:
+            self.option_str = option_str.lower()
+            self.options = make_options_from_str(self.option_str)
+            self.parse_options()
+
+        signal = np.zeros(self.npoints)
+        signal += self.bsl
+        signal += np.random.randn(self.npoints) * self.sigma
+        if 'step' in self.options:
+            signal[self.step_start:self.step_stop] += self.step_height
+        if 'triangle' in self.options:
+            for pulse in self.pulses:
+                pos = pulse[0]
+                height = pulse[1]
+                rise = pulse[2]
+                fall = pulse[3]
+                start = pos - rise
+                stop = pos + fall
+                signal[start:pos] += np.linspace(0., height, rise)
+                signal[pos:stop] += np.linspace(height, 0. , fall)
+        if 'spike' in self.options:
+            for spike in self.spikes:
+                signal[spike[0]] += spike[1]
+        return signal 
+
+    def __str__(self):
+        s = self.name + '\n'
+        s += 'possible options and parameters\n'
+        s += ' * len:      number of samples (100)\n'
+        s += ' * noise:    sigma (1)\n'
+        s += ' * bsl:      level (-0.5)\n'
+        s += ' * step:     height, start, end\n'
+        s += ' * triangle: pos height risingedge, fallingedge [pos height ...]\n'
+        s += ' * spike:    pos height [pos height ...]\n'
+        
+        s += 'current options are:\n'
+        for key in self.options.keys():
+            s += key + ':' + str(self.options[key]) + '\n'
+        return s
+
+
+class SignalGeneratorCSV(object):
+    
+    def __init__(self, file_name, option_str = 'len 100 noise 3', name = 'SignalGenerator'):
+        time, maxprob, mean, median = np.loadtxt( file_name, delimiter=',', unpack=True)
+        csv_data = maxprob
+        
+        # csv data was downshifted, I shift it up here
+        self.csv_data = csv_data - csv_data.min()
+        
+
+        self.__module__ = 'CSV generator'
+        self.option_str = option_str.lower()
+        self.options = make_options_from_str(option_str)
+        self.parse_options()
+        self.name = name
+        
+    def parse_options(self):
+        o = self.options #shortcut
+        if 'len' in o:
+            self.npoints = int(o['len'][0])
+        else: 
+            self.npoints = 1024
+        if 'noise' in o:
+            self.sigma = float(o['noise'][0])
+        else:
+            self.sigma = 1
+        if 'bsl' in o:
+            self.bsl = float(o['bsl'][0])
+        else:
+            self.bsl = -0.5
+        
+        if 'step' in o:
+            self.step_height = float(o['step'][0])
+            self.step_start = int(o['step'][1])
+            self.step_stop = int(o['step'][2])
+
+        if 'triangle' in o:
+            self.pulses = []
+            # append 1st pulse to list of pulses
+            self.pulses.append( ( float(o['triangle'][0]) , float(o['triangle'][1]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+            number_of_pulses_after_1st = (len(o['triangle'])-4)/2
+            for i in range(number_of_pulses_after_1st):
+                self.pulses.append( ( float(o['triangle'][2*i+4]) , float(o['triangle'][2*i+5]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+
+        if 'spike' in o:
+            self.spikes = []
+            for i in range(len(o['spike'])/2):
+                self.spikes.append( ( int(o['spike'][2*i]), float(o['spike'][2*i+1]) ) )
+        
+        if 'csv' in o:
+            self.csvs = []
+            for i in range(len(o['csv'])/2):
+                time = int( o['csv'][2*i] )
+                amplitude = float( o['csv'][2*i+1] )
+                self.csvs.append( (time, amplitude) )
+        if 'rate' in o:
+            self.rate = float(o['rate'][0])
+        
+        if 'signal' in o:
+            self.amplitude = float(o['signal'][0])
+            self.position  = int(o['signal'][1])
+
+    def __call__(self, option_str = ''):
+        if option_str:
+            self.option_str = option_str.lower()
+            self.options = make_options_from_str(self.option_str)
+            self.parse_options()
+
+        signal = np.zeros(self.npoints)
+        signal += self.bsl
+        
+        # shortcut
+        o = self.options
+        
+        if 'step' in o:
+            signal[self.step_start:self.step_stop] += self.step_height
+        if 'triangle' in o:
+            for pulse in o:
+                pos = pulse[0]
+                height = pulse[1]
+                rise = pulse[2]
+                fall = pulse[3]
+                start = pos - rise
+                stop = pos + fall
+                signal[start:pos] += np.linspace(0., height, rise)
+                signal[pos:stop] += np.linspace(height, 0. , fall)
+        if 'spike' in o:
+            for spike in self.spikes:
+                signal[spike[0]] += spike[1]
+                
+        if 'csv' in o:
+            for csv in self.csvs:
+                amplitude = csv[1]
+                time = csv[0]
+                csv_data = self.csv_data.copy()
+                #scale
+                csv_data *= amplitude
+                # add shifted
+                signal[time:time+len(csv_data)] += csv_data
+                
+        if 'rate' in o:
+            self._add_template_pulses(signal, self.rate)
+
+        if 'signal' in o:
+            self._add_signal(signal)
+
+        # add noise
+        if 'noise' in o:
+            signal += + np.random.normal(0.0,self.sigma, signal.shape)
+        return signal 
+        
+    def _add_signal(self, signal):
+        a = self.amplitude
+        p = self.position
+        
+        csv_data = self.csv_data
+        csv = csv_data.copy() * a
+        
+        npoints = self.npoints + 2 * len(csv_data)
+        internal_signal = np.zeros(npoints)
+        
+        internal_signal[p-69+len(csv_data):p+2*len(csv_data)-69] += csv
+
+        signal += internal_signal[len(csv_data):-len(csv_data)]
+
+    def _add_template_pulses(self, signal, rate):
+        
+        csv_data = self.csv_data
+        period = 2.*1e9/(float(rate)*1e6) # in slices
+        # in order to simulate pulses which are just at the beginning and 
+        # at the end of the signal, we pre- and append some points
+        npoints = self.npoints + 2 * len(csv_data)
+        
+        internal_signal = np.zeros(npoints)
+        
+        d=np.random.exponential(period)
+        pulse_positions = []
+        while d<npoints-len(csv_data):
+            pulse_positions.append(d)
+            d+=np.random.exponential(period)
+            
+        for pos in pulse_positions:
+            pos = int(pos + 0.5)
+            internal_signal[pos:pos+len(csv_data)] += csv_data
+            
+        signal += internal_signal[len(csv_data):-len(csv_data)]
+
+    def __str__(self):
+        s = self.name + '\n'
+        s += 'possible options and parameters\n'
+        s += ' * len:      number of samples (100)\n'
+        s += ' * noise:    sigma (1)\n'
+        s += ' * bsl:      level (-0.5)\n'
+        s += ' * step:     height, start, end\n'
+        s += ' * triangle: pos height risingedge, fallingedge [pos height ...]\n'
+        s += ' * spike:    pos height [pos height ...]\n'
+        s += ' * csv:      pos height [pos height ...]\n'
+        
+        s += 'current options are:\n'
+        for key in self.options.keys():
+            s += key + ':' + str(self.options[key]) + '\n'
+        return s
+
+
+# Helper function to parse signalname and create a dictionary
+# dictionary layout :
+# key : string
+# value : [list of parameters]
+def make_options_from_str(signalname):
+    options = {}
+    for word in (signalname.lower()).split():
+        if word.isalpha():
+            current_key = word
+            options[current_key] = []
+#        if word.isdigit():
+        else:
+            options[current_key].append(word)
+#        else:
+#            print '-nothing'
+    return options
+    
+if __name__ == '__main__':
+
+    num_events = 10
+
+    # interesting
+    phe = 3  # i.e. the signal amplitude
+    rate = 50 # MHz
+    noise = 1 # mV sigma
+    
+    if len(sys.argv) > 1:
+        num_events = int(sys.argv[1])
+    if len(sys.argv) > 2:
+        phe = float(sys.argv[2])
+    if len(sys.argv) > 3:
+        rate = float(sys.argv[3])
+    if len(sys.argv) > 4:
+        noise = float(sys.argv[4])
+    
+    
+    #less interesting
+    length = 1000
+    baseline = 0.0
+    signal_pos = 65 
+    
+    generator_string = 'len ' + str(length) + ' '
+    generator_string += 'bsl ' + str(baseline) + ' '
+    generator_string += 'signal ' + str(phe) + ' ' + str(signal_pos) + ' '
+    generator_string += 'noise ' + str(noise) + ' '
+    generator_string += 'rate ' + str(rate) + ' '
+    gen = SignalGeneratorCSV('PulseTemplate_PointSet_0.csv', generator_string)
+    print gen
+    
+    rootfilename = str(phe)+'phe'
+    rootfilename += '_'+str(rate)+'MHz'
+    rootfilename += '_'+str(noise)+'mV'
+    rootfilename += '_'+str(num_events)
+    rootfilename += '.root'
+    
+    
+    
+    file = TFile(rootfilename, 'recreate')
+    for event in range(10):
+        signal = gen()
+        
+        histogram_title = str(phe)+'phe @' + str(signal_pos)
+        histogram_title += ' and ' + str(rate) +'MHz dark count rate'
+        histogram_title += ', electronics noise with sigma=' + str(noise) +'mV'
+        histogram_title += ' #' + str(event)
+        
+        hist = TH1D('hist',histogram_title, length, -0.5,length-0.5)
+        hist.SetStats(kFALSE)
+        hist.SetXTitle('time in slices')
+        hist.SetYTitle('amplitude in mV - no baseline adjustment done yet :-( ')
+        
+        for i,s in enumerate(signal):
+            hist.SetBinContent(i+1,s)
+        hist.Write()
+        del hist
+    file.Close()
Index: fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/generator.py
===================================================================
--- fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/generator.py	(revision 13468)
+++ fact/tools/pyscripts/sandbox/dneise/mc_pulses_for_sabrina/generator.py	(revision 13468)
@@ -0,0 +1,303 @@
+#!/usr/bin/python -tt
+#
+# Dominik Neise, Werner Lustermann
+# TU Dortmund, ETH Zurich
+#
+import numpy as np
+from ROOT import *
+
+class SignalGenerator(object):
+    """ Signal Generator
+        generates signals for testing several helper classes like:
+            * fir filters
+            * signal extractors
+    """
+    
+    def __init__(self, option_str = 'len 100 noise 3', name = 'SignalGenerator'):
+        """ initialize the generator
+            sets default signal to generate
+        """
+        self.__module__ = 'generator'
+        self.option_str = option_str.lower()
+        self.options = make_options_from_str(option_str)
+        self.parse_options()
+        self.name = name
+        
+    def parse_options(self):
+        o = self.options #shortcut
+        if 'len' in o:
+            self.npoints = int(o['len'][0])
+        else: 
+            self.npoints = 100
+        if 'noise' in o:
+            self.sigma = float(o['noise'][0])
+        else:
+            self.sigma = 1
+        if 'bsl' in o:
+            self.bsl = float(o['bsl'][0])
+        else:
+            self.bsl = -0.5
+        
+        if 'step' in o:
+            self.step_height = float(o['step'][0])
+            self.step_start = int(o['step'][1])
+            self.step_stop = int(o['step'][2])
+
+        if 'triangle' in o:
+            self.pulses = []
+            # append 1st pulse to list of pulses
+            self.pulses.append( ( float(o['triangle'][0]) , float(o['triangle'][1]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+            number_of_pulses_after_1st = (len(o['triangle'])-4)/2
+            for i in range(number_of_pulses_after_1st):
+                self.pulses.append( ( float(o['triangle'][2*i+4]) , float(o['triangle'][2*i+5]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+
+        if 'spike' in o:
+            self.spikes = []
+            for i in range(len(o['spike'])/2):
+                self.spikes.append( ( int(o['spike'][2*i]), float(o['spike'][2*i+1]) ) )
+
+    def __call__(self, option_str = ''):
+        if option_str:
+            self.option_str = option_str.lower()
+            self.options = make_options_from_str(self.option_str)
+            self.parse_options()
+
+        signal = np.zeros(self.npoints)
+        signal += self.bsl
+        signal += np.random.randn(self.npoints) * self.sigma
+        if 'step' in self.options:
+            signal[self.step_start:self.step_stop] += self.step_height
+        if 'triangle' in self.options:
+            for pulse in self.pulses:
+                pos = pulse[0]
+                height = pulse[1]
+                rise = pulse[2]
+                fall = pulse[3]
+                start = pos - rise
+                stop = pos + fall
+                signal[start:pos] += np.linspace(0., height, rise)
+                signal[pos:stop] += np.linspace(height, 0. , fall)
+        if 'spike' in self.options:
+            for spike in self.spikes:
+                signal[spike[0]] += spike[1]
+        return signal 
+
+    def __str__(self):
+        s = self.name + '\n'
+        s += 'possible options and parameters\n'
+        s += ' * len:      number of samples (100)\n'
+        s += ' * noise:    sigma (1)\n'
+        s += ' * bsl:      level (-0.5)\n'
+        s += ' * step:     height, start, end\n'
+        s += ' * triangle: pos height risingedge, fallingedge [pos height ...]\n'
+        s += ' * spike:    pos height [pos height ...]\n'
+        
+        s += 'current options are:\n'
+        for key in self.options.keys():
+            s += key + ':' + str(self.options[key]) + '\n'
+        return s
+
+
+class SignalGeneratorCSV(object):
+    
+    def __init__(self, file_name, option_str = 'len 100 noise 3', name = 'SignalGenerator'):
+        time, maxprob, mean, median = np.loadtxt( file_name, delimiter=',', unpack=True)
+        csv_data = maxprob
+        
+        # csv data was downshifted, I shift it up here
+        self.csv_data = csv_data - csv_data.min()
+        
+
+        self.__module__ = 'CSV generator'
+        self.option_str = option_str.lower()
+        self.options = make_options_from_str(option_str)
+        self.parse_options()
+        self.name = name
+        
+    def parse_options(self):
+        o = self.options #shortcut
+        if 'len' in o:
+            self.npoints = int(o['len'][0])
+        else: 
+            self.npoints = 1024
+        if 'noise' in o:
+            self.sigma = float(o['noise'][0])
+        else:
+            self.sigma = 1
+        if 'bsl' in o:
+            self.bsl = float(o['bsl'][0])
+        else:
+            self.bsl = -0.5
+        
+        if 'step' in o:
+            self.step_height = float(o['step'][0])
+            self.step_start = int(o['step'][1])
+            self.step_stop = int(o['step'][2])
+
+        if 'triangle' in o:
+            self.pulses = []
+            # append 1st pulse to list of pulses
+            self.pulses.append( ( float(o['triangle'][0]) , float(o['triangle'][1]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+            number_of_pulses_after_1st = (len(o['triangle'])-4)/2
+            for i in range(number_of_pulses_after_1st):
+                self.pulses.append( ( float(o['triangle'][2*i+4]) , float(o['triangle'][2*i+5]), int(o['triangle'][2]), int(o['triangle'][3]) ) )
+
+        if 'spike' in o:
+            self.spikes = []
+            for i in range(len(o['spike'])/2):
+                self.spikes.append( ( int(o['spike'][2*i]), float(o['spike'][2*i+1]) ) )
+        
+        if 'csv' in o:
+            self.csvs = []
+            for i in range(len(o['csv'])/2):
+                time = int( o['csv'][2*i] )
+                amplitude = float( o['csv'][2*i+1] )
+                self.csvs.append( (time, amplitude) )
+        if 'rate' in o:
+            self.rate = float(o['rate'][0])
+        
+        if 'signal' in o:
+            self.amplitude = float(o['signal'][0])
+            self.position  = int(o['signal'][1])
+
+    def __call__(self, option_str = ''):
+        if option_str:
+            self.option_str = option_str.lower()
+            self.options = make_options_from_str(self.option_str)
+            self.parse_options()
+
+        signal = np.zeros(self.npoints)
+        signal += self.bsl
+        
+        # shortcut
+        o = self.options
+        
+        if 'step' in o:
+            signal[self.step_start:self.step_stop] += self.step_height
+        if 'triangle' in o:
+            for pulse in o:
+                pos = pulse[0]
+                height = pulse[1]
+                rise = pulse[2]
+                fall = pulse[3]
+                start = pos - rise
+                stop = pos + fall
+                signal[start:pos] += np.linspace(0., height, rise)
+                signal[pos:stop] += np.linspace(height, 0. , fall)
+        if 'spike' in o:
+            for spike in self.spikes:
+                signal[spike[0]] += spike[1]
+                
+        if 'csv' in o:
+            for csv in self.csvs:
+                amplitude = csv[1]
+                time = csv[0]
+                csv_data = self.csv_data.copy()
+                #scale
+                csv_data *= amplitude
+                # add shifted
+                signal[time:time+len(csv_data)] += csv_data
+                
+        if 'rate' in o:
+            self._add_template_pulses(signal, self.rate)
+
+        if 'signal' in o:
+            self._add_signal(signal)
+
+        # add noise
+        if 'noise' in o:
+            signal += + np.random.normal(0.0,self.sigma, signal.shape)
+        return signal 
+        
+    def _add_signal(self, signal):
+        a = self.amplitude
+        p = self.position
+        
+        csv_data = self.csv_data
+        csv = csv_data.copy() * a
+        
+        npoints = self.npoints + 2 * len(csv_data)
+        internal_signal = np.zeros(npoints)
+        
+        internal_signal[p-69+len(csv_data):p+2*len(csv_data)-69] += csv
+
+        signal += internal_signal[len(csv_data):-len(csv_data)]
+
+    def _add_template_pulses(self, signal, rate):
+        csv_data = self.csv_data
+        period = 2.*1e9/(float(rate)*1e6) # in slices
+        # in order to simulate pulses which are just at the beginning and 
+        # at the end of the signal, we pre- and append some points
+        npoints = self.npoints + 2 * len(csv_data)
+        
+        internal_signal = np.zeros(npoints)
+        
+        d=np.random.exponential(period)
+        pulse_positions = []
+        while d<npoints-len(csv_data):
+            pulse_positions.append(d)
+            d+=np.random.exponential(period)
+            
+        for pos in pulse_positions:
+            pos = int(pos + 0.5)
+            internal_signal[pos:pos+len(csv_data)] += csv_data
+            
+        signal += internal_signal[len(csv_data):-len(csv_data)]
+
+    def __str__(self):
+        s = self.name + '\n'
+        s += 'possible options and parameters\n'
+        s += ' * len:      number of samples (100)\n'
+        s += ' * noise:    sigma (1)\n'
+        s += ' * bsl:      level (-0.5)\n'
+        s += ' * step:     height, start, end\n'
+        s += ' * triangle: pos height risingedge, fallingedge [pos height ...]\n'
+        s += ' * spike:    pos height [pos height ...]\n'
+        s += ' * csv:      pos height [pos height ...]\n'
+        
+        s += 'current options are:\n'
+        for key in self.options.keys():
+            s += key + ':' + str(self.options[key]) + '\n'
+        return s
+
+
+# Helper function to parse signalname and create a dictionary
+# dictionary layout :
+# key : string
+# value : [list of parameters]
+def make_options_from_str(signalname):
+    options = {}
+    for word in (signalname.lower()).split():
+        if word.isalpha():
+            current_key = word
+            options[current_key] = []
+#        if word.isdigit():
+        else:
+            options[current_key].append(word)
+#        else:
+#            print '-nothing'
+    return options
+    
+if __name__ == '__main__':
+    from plotters import Plotter
+    #myGenerator = SignalGenerator('len 400 noise 0.3 bsl -2.5 triangle 50 10.2 10 100 65 10 150 20 spike 100 50. 20 50 21 49')
+    #sig = myGenerator()
+    #print myGenerator
+    
+    #p = Plotter('generator test')
+    #p(sig)
+    
+    anothergen = SignalGeneratorCSV('PulseTemplate_PointSet_0.csv', 
+                'len 300 noise 1 bsl 0.0 rate 50                signal 3 65')
+    print anothergen
+    
+    pp = Plotter('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa')
+    
+    while 1:
+        sig2 = anothergen()
+        pp(sig2)
+    
+        ret = raw_input('any key to quit')
+        if 'q' in ret:
+            break
+            
